|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
缺点:安全性不是太差了,还行,只要你充分利用系统自带的工具;唯一缺点就是执行效率慢,如何进行网站优化以后,效果会比较好。listdrives.aspx
<%@PageLanguage="C#"%>
<%@ImportNamespace="System"%>
<%@ImportNamespace="System.IO"%>
<%
stringqdrives=Environment.OSVersion.ToString();
stringqnewline=Environment.SystemDirectory.ToString();
stringqmo=Environment.WorkingSet.ToString();
intqtick=Environment.TickCount;
qtick/=60000;
string[]achDrives=Directory.GetLogicalDrives();
intnNumOfDrives=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(inti=0;i<nNumOfDrives;i++)
{
Response.Write("<li><ahref="listdir.aspx?dir=");
Response.Write(Server.UrlEncode(achDrives[i]));
Response.Write("">"+achDrives[i]);
Response.Write("</a><br>");
}
Response.Write("</ul>");
%>
listdir.aspx
<%@PageLanguage="C#"debug="true"%>
<%@ImportNamespace="System.IO"%>
<%
stringstrDir2List=Request.QueryString.Get("dir");
DirectorythisOne=null;
try
{
thisOne=newDirectory(strDir2List);
//AuslesenderEigenschaftenderVerzeichnisses
Response.Write("<p>创立工夫:"+thisOne.CreationTime.ToString()+"</p>");
Directory[]subDirectories=thisOne.GetDirectories();
Response.Write("<ul>");
Response.Write("-------------------------------文件夹-------------------------");
Response.Write("<br>");
for(inti=0;i<subDirectories.Length;i++)
{
Response.Write("<li><ahref="listdir.aspx?dir=");
Response.Write(Server.UrlEncode(subDirectories[i].FullName));
Response.Write("">"+subDirectories[i].Name);
Response.Write("</a><br>");
}
Response.Write("</ul>");
File[]theFiles=thisOne.GetFiles();
Response.Write("<ul>");
Response.Write("-------------------------------文件----------------------------");
Response.Write("<br>");
for(inti=0;i<theFiles.Length;i++)
{
Response.Write("<li><ahref="showfile.aspx?file=");
Response.Write(Server.UrlEncode(theFiles[i].FullName));
Response.Write("">"+theFiles[i].Name);
Response.Write("</a><br>");
}
Response.Write("</ul>");
}
catch(Exceptione)
{
Response.Write("因为以下缘故原由没法完成此功效:");
Response.Write(e.ToString()+"");
Response.End();
}
%>
showfile.aspx
<%@PageLanguage="C#"Debug="true"%>
<%@ImportNamespace="System.IO"%>
<html>
<head><title>FileInfo</title></head>
<body>
<%
stringstrFile2Show=Request.QueryString.Get("file");
FilethisOne=newFile(strFile2Show);
%>
<table>
<tr><td>文件名:</td><td><%=thisOne.Name%></td></tr>
<tr><td>全名:</td><td><%=thisOne.FullName%></td></tr>
<tr><td>文件创立日期:</td><td><%=thisOne.CreationTime.ToString()%></td></tr>
<tr><td>文件巨细:</td><td><%=thisOne.Length.ToString()%>Bytes</td></tr>
<tr><td>前次利用工夫:</td><td><%=thisOne.LastAccessTime.ToString()%></td></tr>
<tr><td>前次修正工夫:</td><td><%=thisOne.LastWriteTime.ToString()%></td></tr>
</table>
<%
StreamReadertheReader=thisOne.OpenText();
char[]theBuffer=newchar[1000];
intnRead=theReader.ReadBlock(theBuffer,0,1000);
Response.Write("<br>");
Response.Write("文件内容预览:");
Response.Write("<br>");
Response.Write("<pre>");
Response.Write(Server.HtmlEncode(newString(theBuffer,0,nRead)));
Response.Write("</pre>");
%>
</body>
</html>
正在丰厚成办理用,整合上传,修正,删除等办理功效
不知有无这么多工夫了
勉力吧,伴侣
转自:静态网制造指南www.ckuyun.comasp,jsp,php是web开发的三大技术,asp简单易用且有microsoft做靠山,jsp功能强大是因为有java支持,php则开源跨平台.在国内,asp应用范围最广,jsp发展势头最猛,php则处于劣势.这可能与公司的支持以及技术的培训有关. |
|