[求助]列驱动器目录错误??
以下是代码,红色的错误,鼠标放上去显示:"class System.IO.Directory 公开应用于创建 移动和枚举通过目录和子目录和静态方法,无法继承此类." 浏览器显示错误是:"编译器错误信息: CS0723: 无法声明静态类型“System.IO.Directory”的变量"
protected void Page_Load(object sender, EventArgs e)
{
string strDir2List = Request.QueryString.Get("dir");
Directory thisOne = null;
try
{
thisOne = new Directory(Dir2List);
//Reading the directory properties
Response.Write("<p>Creation:" + thisOne.CreationTime.ToString() + "</p>");
Directory[] subDirectories = thisOne.GetDirectories();
Response.Write("<ul>");
for (int i = 0; i < subDirectories.Length; i++)
{
Response.Write("<li><a href=\'listdir.aspx?dir=Server.UrlEncode(subDirectories[i].FullName)''\'>" + subDirectories[i].Name + "</a>");
}
Response.Write("<ul>");
File[] theFiles = thisOne.GetFiles();
Response.Write("ul");
for (int i = 0; i < theFiles.Length; i++)
{
Response.Write("<li><a href=\'showfile.aspx?file=Server.UrlEncode(theFile[i].FullName)''\'>" + theFiles[i].Name + "</a>");
}
Response.Write("/ul");
}
catch (Exception e)
{
Response.Write("Access not possible.error:<i>" + e.ToString + "</i>");
Response.End();
}
}