list all css files in a directory and sub directory

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
 
E

Eliyahu Goldin

Security? Make sure the account you are running under has enough user
rights.

Eliyahu
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top