Results 1 to 4 of 4

Thread: [2005] Number of Folders\Files

  1. #1

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    [2005] Number of Folders\Files

    Is there any direct function to get number of folder/Files in a Folder?

    I want the "contains" informations in the folder properties..
    Visual Studio.net 2010
    If this post is useful, rate it


  2. #2

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: [2005] Number of Folders\Files

    GetFiles(path).length is the one..

    but i need inner files, now am doing search recursively..
    Visual Studio.net 2010
    If this post is useful, rate it


  3. #3

    Thread Starter
    Fanatic Member vijy's Avatar
    Join Date
    May 2007
    Location
    India
    Posts
    548

    Re: [2005] Number of Folders\Files

    Code:
     Dim oTemp As System.IO.DirectoryInfo
            oTemp = New System.IO.DirectoryInfo("C:\Program files")
            Dim iFileVal As Integer = oTemp.GetFiles("*.*", IO.SearchOption.AllDirectories).Length
            Dim iFolderVal As Integer = oTemp.GetDirectories("*.*", IO.SearchOption.AllDirectories).Length
    i hope this is the way.,..
    Visual Studio.net 2010
    If this post is useful, rate it


  4. #4
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: [2005] Number of Folders\Files

    That's exactly the right way.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width