protected void Page_Load(object sender, EventArgs e)
{
DirectoryInfo dir = new DirectoryInfo(Server.MapPath("../MingShi"));
RenderStr(dir);
Menu.InnerHtml = str.ToString();
}
protected void RenderStr(DirectoryInfo dirInfo)
{
FileInfo[] files = dirInfo.GetFiles("*.wmv");//文件类型
foreach (FileInfo f in files)
{
//处理文件
/***************************************************/
string s = f.FullName.Substring(Server.MapPath(".").Length + 1);
str.Append("<a href='javascript:void(0)' οnclick=/"play('" + Server.UrlEncode(s) + "')/">第 <font color='red'>"+i.ToString()+"</font> 集 " + f.Name.Substring(0, f.Name.IndexOf(".")) + "</a><br/>");
i++;
/***************************************************/
}
DirectoryInfo[] dirs = dirInfo.GetDirectories();
foreach (DirectoryInfo d in dirs)
{
RenderStr(d);
}
}