Question : Count files in folder

I have a web site and I need some code for the aspx.vb page that counts the number of files in the "~/Images/" folder.

Answer : Count files in folder

Try...

Dim i As Integer = Directory.GetFiles(Server.MapPath("~/images/")).Length
myLabel.Text = "There are " & i.ToString & " files in the directory"
Random Solutions  
 
programming4us programming4us