View Full Version : Uniqe Serial Number

Nima Norouzi
07-08-2003, 08:22 AM
Hi every body,

Can anyone help me to get a uniqe serial number from my hard disk by java scripting?

and also I want that serial number won't be changed by hard disk formatting .

thank you so much

07-08-2003, 11:29 AM
Hm, I'm in doubt that JavaScript can reach as far as the system level to produce a unique serial id like you suggested. That would surely involve the MAC address of the network card, and that is already *very* low-level.
Perhaps you elaborate for what you need this serial id - maybe there are different ways you could pursue. One idea I'd have is to use a MD5 hash generated by JavaScript, that's pretty unique depending on the string you use as a seed.

Nima Norouzi
07-08-2003, 07:08 PM
Dear Mordred,

thank you for your reply and the ways you suggested!

but it is important for me to give an unchangeable phrase from each computer on which my script run and whithout asking user to enter something.

I'll be so delighted, if you solve this problem...

thanks for your consideration.:)

07-08-2003, 07:35 PM
The only way for a web site to store information on a user's computer is to leave a cookie. However this will identify user/browser not a computer, not to mention the fact that user can have cookies disabled.
Another possible way to identify a computer is to use IP address using the server side code, but it is not reliable either since quite a few use dynamic addresses and most times you get the IP of the router or firewall anyway.
Therefore, you might as well stop wasting your time on this quest. At the moment there is no way to id a computer using javascript (nor any other web technology to my knowledge: do not think java applet can get to MAC address - which would be the best way to id a machine...)

07-08-2003, 07:48 PM
Nima, I think you're at a dead end here, Vladdy describes the eventual problems of other approaches.
Maybe we can help you if you tell us a little bit more for what you actually need this unique ID. Perhaps there is an alternative you haven't considered yet.

Roy Sinclair
07-08-2003, 09:01 PM
On the Server side, it should be possible to take the current IP address of a user and retrieve the Mac address (which should be sufficient for the requirements stated here) as long as this is taking place on an Intranet. On a Windows/IIS system you should be able to run "NBTSTAT -A xxx.xxx.xxx.xxx>TextFile.txt" and then read the output text file and retrieve the MAC address from that file.