hi
I write a application and store it in a flash memory.
I want to run the application automatically when I connect the flash to computer. in some article in the web i found about autoran but in those ways you should open the flash for ones, but i want to run the application without open the flash.
Loading

Sam HobbsPosted Nov 10, 2011, 9:01 PM
Javeed M ShaikhPosted Nov 10, 2011, 12:07 PM
try this..
create a autorun.ini or autorun.inf (i do not recollect now) file with the following details:
[autorun]
open=MyProgramName.exe
Save the file on your flashdrive and change the attribute of the file so that it is not visible, you can also add an icon if you want, just add the following line in the above created file.
icon=myicon.ico
VulpesPosted Nov 10, 2011, 12:04 PM
http://bytes.com/topic/net/answers/102489-how-detect-usb-device-being-plugged-unplugged
there's some expert WMI code in the final post which can monitor USB events including detecting when a USB device is plugged in.
You should be able to use that to launch your application from the UsbEventArrived event handler.