Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: VB.NET USB
Hello programmers
i m developing an application which runs from a dongle or USB....
if that dongle or usb removed from pc then application should be exit.
I want to give copy right protection like one application can be installed in one pc only.
now i dont know how to do all this...... i want to know which port contains a dongle in which my application is isntalled.
if u can give me any example then it is better.
thanx in advance
Posted 9-Apr-12 3:31am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

If you read Application.ExecutablePath, it gives you the disk reference for the application file that started the program. So if you program is called WhereAmI.exe and it is on a USB that appears as the "H" drive, Application.ExecutablePath will give you
You can use this to monitor for USB removal:[^] gives the basic code. It's in C#, but it's pretty obvious.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 CPallini 385
1 Sergey Alexandrovich Kryukov 262
2 OriginalGriff 200
3 George Jonsson 134
4 Richard MacCutchan 110
0 OriginalGriff 6,344
1 Sergey Alexandrovich Kryukov 5,890
2 CPallini 5,175
3 George Jonsson 3,559
4 Gihan Liyanage 2,522

Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 9 Apr 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100