05-15-2011, 03:31 AM
Translated to VB.NET
Code:
Public Shared Sub usbcheck()
Dim drives() As DriveInfo = DriveInfo.GetDrives
For Each drive As DriveInfo In drives
If (drive.DriveType = DriveType.Removable) Then
If (drive.RootDirectory.Root.ToString(0) = Environment.CurrentDirectory(0)) Then
Else
' Not USB Drive
End If
End If
Next
End Sub