listing1301.aspx

来自「asp入门到精通的源代码」· ASPX 代码 · 共 36 行

ASPX
36
字号
<%@ Import Namespace="System.IO" %>
<script language="VB" runat="server">
   
   sub Page_Load(obj as object, e as eventargs)
      dim f as new FileInfo(Server.MapPath("listing1301.aspx"))

      lblMessage.Text = "File information<br>" & _
         "<b>Name: </b>" & f.Name & "<br>" & _
         "<b>Path: </b>" & f.DirectoryName & "<br>" & _
         "<b>Last access time: </b>" & f.LastAccessTime & _
            "<br>" & _
         "<b>Last write time: </b>" & f.LastWriteTime & _
            "<br>" & _
         "<b>Length: </b>" & f.Length & " bytes<p>"
      
         
      'return parent directory
      dim dir as DirectoryInfo = f.Directory
      
      lblMessage.Text += "Directory information<br>" & _
         "<b>Name: </b>" & dir.Name & "<br>" & _
         "<b>Full name: </b>" & dir.FullName & "<br>" & _
         "<b>Last access time: </b>" & dir.LastAccessTime & _
            "<br>" & _
         "<b>Last write time: </b>" & dir.LastWriteTime & _
            "<br>" & _
         "<b>Parent: </b>" & dir.Parent.Name & "<br>"
      
   end sub

</script>

<html><body>
   <asp:label id="lblMessage" runat=server/>
</body></html>

⌨️ 快捷键说明

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