Progged programming site

Programming source code, articles, tutorials, links and chat

File properties using ASP.net

The following example will display various properties of a given file isung ASP.net
 
<%@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 : ” [...]

[ Back to top ]

Sponsors