help Items

Posts 31–32 of 32 · Page 3 of 3
Quote Originally Posted by mo3ad001 View Post
that nice But why As DriveInfo ??

[php]For Each drive As DriveInfo In My.Computer.FileSystem.Drives
For Each N As String In [/php]
It's error ...
and i can Remove it Right ?
it's work Perfect but have some lag
Drive Info is need for getting drive properties. In this case, we used its name.

Quote Originally Posted by mo3ad001
and i want just For C Drive ?
how ?
Just check whether the current drive is "C:" :

Code:
For Each drive As DriveInfo In My.Computer.FileSystem.Drives
           
If drive.Name.startswith("C") Then
 For Each N As String In My.Computer.FileSystem.GetDirectories(drive.Name)
                Try
                    For Each x As String In My.Computer.FileSystem.GetFiles(N, FileIO.SearchOption.SearchAllSubDirectories, "*.*")
                        Application.DoEvents()
                        ListBox1.Items.Add(x)
                    Next
                Catch ex As Exception
                    Continue For
                End Try
End If
            Next
        Next
thank you all all work 100000%
thank you
Posts 31–32 of 32 · Page 3 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us