Click here to Skip to main content
12,548,135 members (50,267 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 9 Apr 2012
Copyright © CodeProject, 1999-2016
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