Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C#] Check If Executed From USB Drive
#6
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
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply


Messages In This Thread
RE: [C#] Check If Executed From USB Drive - by euverve - 05-15-2011, 03:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] USB Drive Defender euverve 0 1,224 03-22-2013, 06:21 AM
Last Post: euverve
  [VB.NET] USB Listener wchar_t 1 2,737 09-14-2010, 08:38 PM
Last Post: -BoodyE-
  Check If Executed For First Time. (Simple) wchar_t 3 1,146 08-19-2010, 02:24 PM
Last Post: Buzz Lightyear
  how to connect the USB with the program Shadowdancer 1 827 10-29-2009, 04:47 AM
Last Post: Shadowdancer

Forum Jump:


Users browsing this thread: 1 Guest(s)