|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Cointains: ??? files, ??? foldersOkay, so I have some code that can do a recursive search to get the raw
number of files and folders. No big. As a user, I can right click on any parent folder, get the properites, and then on the general tab, the number of child files and folders are retrieved after a few seconds. Is there any property or anything at all in VB.NET that allows you to access THIS specific information? I'm just looking for an alternate way to get all the child folders of a parent folder near the root of the drive. Military Smurf wrote:
> Okay, so I have some code that can do a recursive search to get the raw You should be able to pass in any "root" folder and get the number of> number of files and folders. No big. > > As a user, I can right click on any parent folder, get the properites, and > then on the general tab, the number of child files and folders are retrieved > after a few seconds. Is there any property or anything at all in VB.NET that > allows you to access THIS specific information? I'm just looking for an > alternate way to get all the child folders of a parent folder near the root > of the drive. child folders and files underneath it. Something like this: Public Sub CountFilesAndFolders(ByVal root As String, ByRef filecount As Integer, ByRef foldercount As Integer) filecount = Directory.GetFiles(root, "*.*", SearchOption.AllDirectories).Length foldercount = Directory.GetDirectories(root, "*.*", SearchOption.AllDirectories).Length End Sub Call it like this: Private Sub Button1_Click(....) Handles Button1.Click Dim iFileCount As Integer = 0 Dim iFolderCount As Integer = 0 CountFilesAndFolders("C:\Root Folder", iFileCount, iFolderCount) MsgBox("Files: " & iFileCount & ", Folders: " & iFolderCount) End Sub HTH
Performance of Queue(of T).Enqueue(T)
How to convert a Byte() to an IntPtr in VB load form in vb.net How to raise a shortcut How to use binary files as resources in VB 2005 Regex.Split... Can I do this?? control array with code added controls Getting external IP Address Is there a equivalent to 'Last Position' in VS2005? how to make string containing " ? |
|||||||||||||||||||||||