list all css files in a directory and sub directory

  • Thread starter Thread starter TJS
  • Start date Start date
T

TJS

I am trying to list all css files in a directory or its subdirectories, but
cannot get file info. What's missing ?


Dim dir As DirectoryInfo = new DirectoryInfo( server.MapPath("~/css"))
Dim fi As FileSystemInfo
try
For Each fi In dir.GetFileSystemInfos()
If fi.GetType() Is GetType(FileInfo) Then
if instr(fi.name,"css")>0 then
messagex.text &= fi.name & ","
end if
End If
Next
catch
end try
 
Security? Make sure the account you are running under has enough user
rights.

Eliyahu
 
Back
Top