list all css files in a directory and sub directory

Discussion in 'ASP .Net' started by TJS, Jun 23, 2004.

  1. TJS

    TJS Guest

    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
     
    TJS, Jun 23, 2004
    #1
    1. Advertisements

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

    Eliyahu

    "TJS" <> wrote in message
    news:...
    > 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
    >
    >
    >
     
    Eliyahu Goldin, Jun 23, 2004
    #2
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tony
    Replies:
    4
    Views:
    2,376
    Andy De Petter
    Nov 27, 2003
  2. Replies:
    1
    Views:
    774
    Evertjan.
    Sep 30, 2005
  3. perseus
    Replies:
    2
    Views:
    456
    Noah Roberts
    Aug 13, 2003
  4. Ben
    Replies:
    2
    Views:
    1,245
  5. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    3,078
    Lawrence D'Oliveiro
    May 20, 2011
  6. Replies:
    1
    Views:
    309
    Evertjan.
    Sep 30, 2005
  7. Dirk Einecke
    Replies:
    8
    Views:
    413
    Robert Klemme
    Apr 19, 2004
  8. lofenee
    Replies:
    3
    Views:
    194
    Ben Bullock
    Apr 22, 2008
Loading...