473,395 Members | 1,379 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Unique Identifier for a machine

Hello,

We are trying to figure out how to get a unique identifier for a machine.
Our application is a C# windows application that talks to our server via a
webservice. Every time our webservice is called, we want to verify that the
user has a valid license. For that we want to identify the user via his/her
machine. I tried using the following

searcher = new ManagementObjectSearcher("SELECT * FROM Win32_DiskDrive");

foreach(ManagementObject wmi_HD in searcher.Get())

{

HardDrive hd = new HardDrive();

hd.Model = wmi_HD["Model"].ToString();

hd.Type = wmi_HD["InterfaceType"].ToString();

hdCollection.Add(hd);

}

searcher = new ManagementObjectSearcher("SELECT * FROM
Win32_PhysicalMedia");
int i = 0;

foreach(ManagementObject wmi_HD in searcher.Get())

{

// get the hard drive from collection

// using index

HardDrive hd = (HardDrive)hdCollection[i];

// get the hardware serial no.

if (wmi_HD["SerialNumber"] == null)

hd.SerialNo = "None";

else

hd.SerialNo = wmi_HD["SerialNumber"].ToString();
++i;

}
In most cases, I get serial number. But in a few cases, I get serial number
for the hard drive as zero. Is there any other way to uniquely identify the
user's machine.

Thanks,
-Nitin
Jul 21 '05 #1
8 2596
Hi Nitin,
Is there any other way to uniquely identify the user's machine.


For your information:
DomainName+ComputerName,
NIC's MAC Address
Processor's Serial Number
Wish it helps!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #2
Gary,

thanks for the info. However, the processor id is not available on P3 and
below and I did not find it on Windows 98 machine. Any other ideas are
welcome.

But this looks like a good starting point.

Thanks,
-Nitin
""Gary Chang"" <v-******@online.microsoft.com> wrote in message
news:FU**************@cpmsftngxa10.phx.gbl...
Hi Nitin,
Is there any other way to uniquely identify the user's machine.


For your information:
DomainName+ComputerName,
NIC's MAC Address
Processor's Serial Number
Wish it helps!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------

Jul 21 '05 #3
Hi Nitin,

Thanks for your response!

If you have the difficulty to query the Processor Serial number, I think
the Network Adapter's MAC address should be a good choice...
Good Luck!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #4
Thanks Gary. Unfortunately, this solution may not work as some of our
clients may not have a Network Adapter (still using Dial-up).

Is there any other option available?

Thanks,
-Nitin
""Gary Chang"" <v-******@online.microsoft.com> wrote in message
news:%2****************@cpmsftngxa10.phx.gbl...
Hi Nitin,

Thanks for your response!

If you have the difficulty to query the Processor Serial number, I think
the Network Adapter's MAC address should be a good choice...
Good Luck!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------

Jul 21 '05 #5
Hi Nitin,
Is there any other option available?


Just for your information, the IP address that the machine is currently
used and maybe you can generate a GUID for your program when the program is
installing to the customer's machine...
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #6
I will try that. Do you know how Microsoft ensures this? If the machine does
not have network card or cannot get processor id. I am thinking of using the
serial number of operating system along with the date and time of install.
Do you think this will be unique enough?

Thanks,
-Nitin

""Gary Chang"" <v-******@online.microsoft.com> wrote in message
news:HI**************@cpmsftngxa10.phx.gbl...
Hi Nitin,
Is there any other option available?


Just for your information, the IP address that the machine is currently
used and maybe you can generate a GUID for your program when the program
is
installing to the customer's machine...
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------

Jul 21 '05 #7
Hi Nitin,

As far as I know, the Windows' Serial Number is not unique per each
system...
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------

Jul 21 '05 #8
Does anyone know how Microsoft or other leading companies do it?

""Gary Chang"" <v-******@online.microsoft.com> wrote in message
news:MN**************@cpmsftngxa10.phx.gbl...
Hi Nitin,

As far as I know, the Windows' Serial Number is not unique per each
system...
Thanks!

Best regards,

Gary Chang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------

Jul 21 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Nitin | last post by:
Hello, We are trying to figure out how to get a unique identifier for a machine. Our application is a C# windows application that talks to our server via a webservice. Every time our webservice...
9
by: dave m | last post by:
I need to be able to retrieve a unique ID from a users PC. I needs to be something a user could not easily change, like the computer name. Could someone point me in the right direction to find ...
4
by: nondisclosure007 | last post by:
Hello all! I have something rather unique. I'm creating a cookie for customization for a webpage. But I want to tie the user to a machine (not friendly, I know, but for what I'm doing, it's...
18
by: JJ | last post by:
Now I know this question has been asked many times, but I cannot seem to find a good site which summarises the methods possible in vb .net. I am after a way of producing a unique serial number...
4
by: ba.hons | last post by:
Hello all, Was wondering if anyone could provide some info on what could be a possible solution to a problem am having. I have to generate a Unique Identifier in C# which I will use to assign...
2
by: Ken | last post by:
Hi, I have a form whose control source is a view from SQL server 2005 database. The view has a primary key that is a unique identifier field with keys generated by newid() function from SQL server...
4
by: Rob Stevens | last post by:
Is there some sort of unique identifier in every treenode that is consistent? I was looking at the handle of every treenode, but it appears that the handle changes everytime the tree is built. ...
4
by: Mufasa | last post by:
I'm looking for a way to get a truly unique identifier for a machine for our client software. I'd like to have it so that there's little or no setup by the end user. (We set up the machines and...
13
by: mliptak | last post by:
I'm trying to implement logging in my application, so that each log message has its unique identifier, e.g. log(identifier, text) What I want to achieve is that the compiler screams if the log()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.