ShowOnPage = "";
string strDir = HttpContext.Current.Server.MapPath("DataBaseUse/BackUp"); System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(strDir);
DirectoryInfo[] diArr = rootDir.GetDirectories(); ShowOnPage = @"<table width='100%' align='center'>";
//获取子文件夹 foreach (System.IO.DirectoryInfo folder1 in diArr)
{
ShowOnPage += "<tr align='center'><td width=50% align='center'>" + folder1.Name + "<td><td width=50% align='center'><a href='BackUp.aspx?id="+folder1.Name+"'>删除备份</a><td></tr>";
}
ShowOnPage += "</table>";
this.Page.DataBind();
string strDir = HttpContext.Current.Server.MapPath("DataBaseUse/BackUp"); System.IO.DirectoryInfo rootDir = new System.IO.DirectoryInfo(strDir);
DirectoryInfo[] diArr = rootDir.GetDirectories(); ShowOnPage = @"<table width='100%' align='center'>";
//获取子文件夹 foreach (System.IO.DirectoryInfo folder1 in diArr)
{
ShowOnPage += "<tr align='center'><td width=50% align='center'>" + folder1.Name + "<td><td width=50% align='center'><a href='BackUp.aspx?id="+folder1.Name+"'>删除备份</a><td></tr>";
}
ShowOnPage += "</table>";
this.Page.DataBind();
解决方案 »
- 像taobao这样的大网站,商品分类很复杂,那么他们的商品是放在一个表里面的还是在不同的表里面呢??
- 图片上传问题(急,请各位多指点)
- 按钮的命名问题 还请高手多多帮忙!
- WebBrowser刷新的问题
- 三楼楼长的OA里为什么在我的树型控件只是文字没有树型结构
- 求SQL语句
- 定义方法时,能不能给这个方法定义说明,命名空间中的方法一样,一移上去就会出现中文说明?
- 请教 动态添加到Table控件里的控件,如何取值,如何解决动态添加的控件消失问题
- winform如何实现拉伸窗口边缘窗口按照初始长宽比缩放大小
- 怎样将C#写的windowsform做成控件发布到web上
- 一个关于string的小问题??
- 字符串查找问题求聪明解法
try:ShowOnPage += "</table>";
Response.Write(ShowOnPage.ToString());
DirectoryInfo[] diArr = rootDir.GetDirectories(); 里面的 diArr是空的,就是没有获取到子目录,郁闷了