对呀,就是一个单独的aspx文件.问题是怎么能够动态的出现文件名及其帖子标题
解决方案 »
- updatepanel 里放datalist Event触发后postback,Page_load被执行?小弟百思不得其解?
- C# 怎么定义一个变量,占内存10个字节
- VS2003所有的代码的颜色都变成了灰色,对象打一点后不出来属性
- 如何把这样一个字符串转换为一个日期型啊
- 急~~~~ group by 问题
- substing(start,end)
- 初试水晶报表,出错,请问是什么问题!?
- 请问一个关于在WEB页面下画图的问题???急!!!!1
- .Net的兄弟们,有人在用JB9的吗?
- 怎样把ASP。NET中的CS文件编译成DLL文件?
- 如何压缩xml字符串?谁能给个算法或解决方案?
- OleDbCommand怎么填充DataSet?
<%@ Import Namespace="System.IO" %>
<script language="C#" runat="server">
void Page_Load (Object o, EventArgs e)
{
string dirName = ".";
string realDirName = Server.MapPath(dirName);
DirectoryInfo di = new DirectoryInfo(realDirName);
string sLine; foreach (FileInfo fi in di.GetFiles("*.xml"))
{
//Response.Write(fi.FullName + "<BR>");
StreamReader sr = new StreamReader(fi.Open( FileMode.Open, FileAccess.Read, FileShare.Read),
System.Text.Encoding.GetEncoding("GB2312"));
while ((sLine = sr.ReadLine()) != null)
{
if (sLine.IndexOf("TopicName")>=0)
{
sLine = sLine.Trim();
sLine = System.Text.RegularExpressions.Regex.Replace(sLine,@"<[^>]+>","");
string sPath = dirName != "."? dirName + "/" + fi.Name:fi.Name;
//instead of outputting, you could append the content to a file
Response.Write("<A HREF='" + sPath + "'>" + sLine + "</A><BR>");
break;
}
}
sr.Close();
}
}
</script>
ps:能不能在列出贴子时按最后更新时间来排序呢?
how to?