hi One and all,
I am trying to build web server for win Mo and i am trying to get the link of folders from certain directory so that it could be click able and could see all of the defined item (say - pictures from that folder..) i am being able to explore certain folders and items but how can i send my link towards html page or how to create a dynamic html page.... I have been in process doing this with little program in c# console mode.
my code is ....
.................................................. ...............................................
StringBuilder sb = new StringBuilder();
sb.AppendLine("<html>");
sb.AppendLine("<head>");
sb.AppendLine("<title>Index of c:\\tike</title>");
sb.AppendLine("</head>");
sb.AppendLine("<body>");
sb.AppendLine("<ul>");
string[] filePaths = Directory.GetFiles(@"c:\tike");
for (int i = 0; i < filePaths.Length; ++i)
{
string name = Path.GetFileName(filePaths[i]);
sb.AppendLine(string.Format("<li><a href=\"{0}\">{1}</a></li>",
HttpUtility.HtmlEncode(HttpUtility.UrlEncode(name) ),
HttpUtility.HtmlEncode(name)));
}
sb.AppendLine("</ul>");
sb.AppendLine("</body>");
sb.AppendLine("</html>");
string result = sb.ToString();
Console.WriteLine(result);
Console.Read();
.................................................. .................................................. ....
As result i see console mode as
<html>
<............>
<li><a href=...................................>
and all whatever i have appended
to sum up i wanted to make those things to run in html page...
any suggestion or snippet would be appreciated.
regards.
Tike


LinkBack URL
About LinkBacks




Reply With Quote



Bookmarks
Algorithms and Data Structures
Java tutorials
Algorithms Forum