>
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>
正在丰富成管理用,整合上传,修改,删除等管理功能
不知有没有这么多时间了
努力吧,朋友 |