Asp Codes
ActiveX
ADO
Array
Code Snippets
Components
Data Access
Date Time
Files
Graphics
HTML Formatting
Mathematics
Miscellaneous
Sessions
SQL
Strings
Techniques
XML
Asp.Net > Code Snippets sample source codes
Display various file properties of files in a folder
Display various file properties of files in a folder <%@Page Language="VB" %> <%@ Import Namespace="System.IO" %> <script language="VB" runat="server"> Sub Page_Load(sender as Object, e as EventArgs) Dim strFiles as String() Dim objFile as System.IO.FileInfo Dim i as integer strFiles = System.IO.Directory.GetFiles(Server.MapPath("/"),"*.*") for i = 0 to strFiles.Length - 1 objFile = new System.IO.FileInfo(strFiles(i)) Response.Write("Name : " & objFile.Name() & "<br>") Response.Write("Extension : " & objFile.Extension() & "<br>") Response.Write("Length : " & Cstr(objFile.Length) & "<br>") Response.Write("Creation Date : " & Cstr(objFile.CreationTime) & "<br>") Response.Write("<br>") next Response.End End Sub </script>
Privacy Policy
|
Link to Us
|
Links