⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showfile.aspx

📁 《精通ASP.NET网络编程》附带实例
💻 ASPX
字号:
  <% @Page Language="C#" %>
    <% @Import Namespace="System.IO" %>
    <html>
    <head><title>File Info</title></head>
    <body>
    <%
    string strFile2Show = Request.QueryString.Get("file");
    FileInfo thisOne = new FileInfo(strFile2Show);
    %>
    <table>
    <tr><td>Name:</td><td><%=thisOne.Name%></td></tr>
    <tr><td>Path:</td><td><%=thisOne.FullName%></td></tr>
    <tr><td>Directory:</td><td><%=thisOne.DirectoryName%></td></tr>
    <tr>
    <td>Date created:</td>
    <td><%=thisOne.CreationTime.ToString()%></td>
    </tr>
    <tr>
    <td>Size:</td>
    <td><%=thisOne.Length.ToString()%> Bytes</td>
    </tr>
    <tr>
    <td>Last access:</td>
    <td><%=thisOne.LastAccessTime.ToString()%></td>
    </tr>
    <tr>
    <td>Last modified:</td>
    <td><%=thisOne.LastWriteTime.ToString()%></td>
    </tr>
    </table>
    <%
    StreamReader theReader = thisOne.OpenText();
    char[] theBuffer = new char[255];
    int nRead = theReader.ReadBlock(theBuffer, 0, 255);
    Response.Write("<pre>");
    Response.Write(Server.HtmlEncode(new String(theBuffer,0,nRead)));
    Response.Write("</pre>");
    %>
    </body>
    </html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -