收集最實用的網頁特效代碼!
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>);
%>
listdir.aspx
<% @page language=c# debug=true %>
<% @import namespace=system.io %>
<%
string strdir2list = request.querystring.get(dir);
directory thisone = null;
try
{
thisone = new directory(strdir2list);
// auslesen der eigenschaften der verzeichnisses
response.write(<p>創建時間: + thisone.creationtime.tostring() + </p>);
directory[] subdirectories = thisone.getdirectories();
response.write(<ul>);
response.write(-------------------------------文件夾------------- ------------);
response.write(<br>);
for (int i=0; i < subdirectories.length; i++)
{
response.write(<li><a href=/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 (int i=0; i < thefiles.length; i++)
{
response.write(<li><a href=/showfile.aspx?file=);
response.write(server.urlencode(thefiles[i].fullname));
response.write(/> + thefiles[i].name);
response.write(</a><br>);
}
response.write(</ul>);
}
catch (exception e)
{
response.write(由於以下原因無法實現此功能: );
response.write(e.tostring() + );
response.end();
}
%>
showfile.aspx
<% @page language=c# debug=true%>
<% @import namespace=system.io %>
<html>
<head><title>file info</title></head>
<body>
<%
string strfile2show = request.querystring.get(file);
file thisone = new file(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>
<%
streamreader thereader = thisone.opentext();
char[] thebuffer = new char[1000];
int nread = thereader.readblock(thebuffer, 0, 1000);
response.write(<br>);
response.write( 文件內容預覽:);
response.write(<br>);
response.write(<pre>);
response.write(server.htmlencode(new string(thebuffer,0,nread)));
response.write(</pre>);
%>
</body>
</html>
正在豐富成管理用,整合上傳,修改,刪除等管理功能
不知有沒有這麼多時間了
努力吧,朋友