Results 1 to 2 of 2

Thread: folder information

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2001
    Location
    INDIA
    Posts
    31

    folder information

    Hi

    I want to idenify how many files are there in the given path.

    Files means

    1) How many folders are there?
    2) How many files are there based on the type (.txt,.doc,...)?

    3) And also tell me what is the similar one for App.Path in VB.NET

    I written code like this

    Dim folderpath As String
    Dim nof As Long
    folderpath = "C:\WINNT\"
    Dim DirInfo As New DirectoryInfo(folderpath)
    nof = DirInfo.GetFiles.GetUpperBound(0)

    Thanks in advance
    Nagendra K

  2. #2
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461
    Dear friend, I'm not sure how App.Path works, because I don't know VB, but perhaps I can help you:

    VB Code:
    1. Dim Intero As Int32
    2.         Dim Dirinfo As New System.IO.DirectoryInfo("e:\alex")
    3.         Intero = Dirinfo.GetDirectories.Length
    4.         Intero = Dirinfo.GetFiles("*.txt").Length
    5.         Dim Goofy As String = System.Windows.Forms.Application.ExecutablePath
    Try this code and say to me if it is useful for you or if I misunderstood what you need. Good job
    Live long and prosper (Mr. Spock)

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