<%@ Page language="c#"%>
<%@Import Namespace="System.IO"%>
<%
string[] achDrives = Directory.GetLogicalDrives();
int nNumOfDrives = achDrives.Length;
Response.Write("<ol>");
for(int i=0;i<nNumOfDrives;i++)
{
Response.Write("<li><a href=/"listdir.aspx?dir=");
Response.Write(Server.UrlEncode(achDrives[i]));
Response.Write("/">"+achDrives[i]);
Response.Write("</a><br>");
}
Response.Write("</ol>");
%>
本实例程序可以列出本地硬盘上所有驱动器
最新推荐文章于 2021-10-19 20:16:57 发布