Luis Alonso Ramos
asked on
Unique machine ID
How can I get an ID that is the same for one machine across reboots, but it is different for each machine?
It must exist on both Windows 9x and NT/2000.
It must exist on both Windows 9x and NT/2000.
ASKER
Sometimes the computer will not have access to the internet or even a network adapter installed. I don't think the IP address would do it.
The hostname is a character string, easily obtained by Ruchi's suggested method (or several others). But users can change the CPU name.
A couple of years ago, Intel got in very hot Public Relations waters for wanting to put serial numbers in the CPUs for this very purpose. The privacy implications are unacceptable to most people, so the computer hardware is (mostly) anonymous and what you're asking for doesn't exist. The Internet industry has somewhat gotten around this by the use of cookies. Cookies, in essence, are unique files that you would store on each machine, and you would put unique data in the file, or in the filename, so you could retrieve it later. Within a corporate setting, this is probably just as acceptable as uniquely ID'ing the hardware.
A couple of years ago, Intel got in very hot Public Relations waters for wanting to put serial numbers in the CPUs for this very purpose. The privacy implications are unacceptable to most people, so the computer hardware is (mostly) anonymous and what you're asking for doesn't exist. The Internet industry has somewhat gotten around this by the use of cookies. Cookies, in essence, are unique files that you would store on each machine, and you would put unique data in the file, or in the filename, so you could retrieve it later. Within a corporate setting, this is probably just as acceptable as uniquely ID'ing the hardware.
ASKER
It does not have a hardware ID... some kind of data that is generated at Windows setup and will remain the same after each boot. The idea is for a program to know it is being run on the machine on which it was installed, and not copied to another one.
ASKER
Oops... In my previous comment "It does not have a hardware ID" should have been "It does not have to be a hardware ID"
Take the value of the Timer method and save it in the registry
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
arcusd, I guess that should work, I'll give it a try.
ASKER
I think that will work... but does it work for UNC paths? how?
Information about UNC paths:
http://www.avdf.com/june98/art_vb006.html
http://www.avdf.com/june98/art_vb006.html
ASKER
My question is if arcusd's routine will work for UNC paths?? If I run my program through the network, how do I know it is valid if I compare the stored volume ID to that of the machine it is running on?
ASKER
Thanks for the tip, you got me on the right track. I still had to modify it a little bit to work for my situation.
"The code shows you User ID, Hostname, IP adress, and Port number of the local machine."