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. Advertising

  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. Advertising

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,137
    Andy De Petter
    Nov 27, 2003
  2. Tee
    Replies:
    2
    Views:
    809
  3. Ben
    Replies:
    2
    Views:
    876
  4. Lawrence D'Oliveiro

    Death To Sub-Sub-Sub-Directories!

    Lawrence D'Oliveiro, May 5, 2011, in forum: Java
    Replies:
    92
    Views:
    2,015
    Lawrence D'Oliveiro
    May 20, 2011
  5. Dirk Einecke
    Replies:
    8
    Views:
    179
    Robert Klemme
    Apr 19, 2004
Loading...

Share This Page