listdrives.aspx
<% @Page Language="C#" %>
<% @Import Namespace="System" %>
<% @Import Namespace="System.IO" %>
<%
string qdrives = Environment.OSVersion.ToString();
string qnewline=Environment.SystemDirectory.ToString();
string qmo=Environment.WorkingSet.ToString();
int qtick=Environment.TickCount;
qtick/=60000;
string[] achDrives = Directory.GetLogicalDrives();
int nNumOfDrives = achDrives.Length;
Response.Write("您的系統是:");
Response.Write(qdrives);
Response.Write("<br>");
Response.Write("您的可用內存是:");
Response.Write(qmo);
Response.Write("<br>");
Response.Write("自上次重啟已經有");
Response.Write(qtick.ToString());
Response.Write("分鐘了");
Response.Write("<br>");
Response.Write("<br>");
Response.Write("<br>");
Response.Write("查看你的磁盤:");
Response.Write("<ul>");
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("</ul>");
%>