views:

398

answers:

6

Hello,
I have c# program (.exe), I will give it to other people, and want that exe to work only from where it was run the first time, any copy should no not work. How can I do it?
VERY THANKS

+3  A: 

It is not possible. A copy being a precise copy will have no way of knowing that it is a copy and not the original. Therefore at each first run of a copy on any machine the game will start again.

The other approach you can think of is to use activation. Your program will talk to the server online and will report the first run, regardless of whether it was a copy or not. Then at each successive run the program will ask the server if it's been running on the same machine as the first time. If yes, it will run, if no, it will immediately exit.

For this to work, you will need to come up with some kind of machine signature that your program will generate and transmit to the server.

Developer Art
A: 

you can use CD and protect the CD from copying, and then you should allow your program to run from the CD drive only.

Wael Dalloul
A: 

Use click once deployment, it will be difficult for simple user to find and copy from download chache, and than you can write crypted exe location somewhere in the registry and check it every time the program is run

ArsenMkrt
+1  A: 

record the exe location in the registry when first launched. and check the location when it's launched next.

Benny
A: 

A lot of things that you can do here.

All the suggestions above are good too. Another option is you can have a installer that generates a key that binds your application to the machine installed. Transferring to other machine won't work since it will have a different machine key signature.

Marc Vitalis
thanks, and what about DirectorySecurity Class (System.Security.AccessControl)
Armen Khachatryan
other people can install it to other comp, i do not wnat this
Armen Khachatryan
A: 

sorry its an old thread. Why not read the hard drive serial number (which should be unique) sent it to a server as part of activation and make sure that all that is the same.

blah