<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
string mdir;
// mdir = "c:/inetpub/wwwroot/lib/javascript/";
mdir = "c:/inetpub/wwwroot/lib/"+ Request["Dir"]+"/";
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(mdir);
Response.Clear();
Response.ContentType = "text/xml";
System.Xml.XmlTextWriter xtwFeed = new System.Xml.XmlTextWriter(Response.OutputStream, Encoding.UTF8);
xtwFeed.WriteStartDocument();
// The mandatory rss tag
xtwFeed.WriteStartElement("rss");
xtwFeed.WriteAttributeString("version", "2.0");
xtwFeed.WriteStartElement("channel");
xtwFeed.WriteElementString("title", "Hello word(" + Request["Dir"]+")");
xtwFeed.WriteElementString("link", "http://localhost/default.aspx");
xtwFeed.WriteElementString("description", mdir);
// xtwFeed.WriteElementString("copyright", "Copyright 2013 - 2018 All rights reserved.");
foreach (System.IO.FileInfo fi in di.GetFiles())
{
xtwFeed.WriteStartElement("item");
xtwFeed.WriteElementString("title", fi.Name);
xtwFeed.WriteElementString("description", "description" );
xtwFeed.WriteElementString("link", "http://localhost/Lib/" + Request["Dir"]+"/" + fi.Name);
xtwFeed.WriteElementString("pubDate", "pubDate" );
xtwFeed.WriteEndElement();
}
// Close all tags
xtwFeed.WriteEndElement();
xtwFeed.WriteEndElement();
xtwFeed.WriteEndDocument();
xtwFeed.Flush();
xtwFeed.Close();
Response.End();
%>
<script type="text/javascript" runat="server" >
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div id="ttt">
fghgh
</div>
</form>
</body>
</html>