Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C#] Check If Executed From USB Drive
#1
Quote:public static void usbcheck()
{
DriveInfo[] drives = DriveInfo.GetDrives();
{

foreach (DriveInfo drive in drives)
if (drive.DriveType == DriveType.Removable)
if (drive.RootDirectory.Root.ToString()[0] == Environment.CurrentDirectory[0])
// Is USB Drive
else
{
// Not USB Drive
}
}
}

Grabbed from my TBOT Source.

it doesnt have to have a malware application.

very usefull code.
Reply


Messages In This Thread
[C#] Check If Executed From USB Drive - by wchar_t - 08-13-2010, 01:39 PM

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

Forum Jump:


Users browsing this thread: 1 Guest(s)