472,139 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

find uniq no from pc

blossam
29
hi frnds,
this is my first question, hope u will help me
i want to find some uniw no from pc using which i can identify all pc uniqly
like processor no, motherbord id or any processor serial no
its urgent send my some sugge.
May 30 '07 #1
5 2063
kenobewan
4,871 Expert 4TB
Welcome to the site. Sorry I can't undertand your question.
May 30 '07 #2
Plater
7,872 Expert 4TB
Check into WMI usage. You can pull BOATLOADS of information about a system with it.
Including all those ID numbers you were looking for.

I would suggest looking for MAC addys and maybe the windows product key?
MAC addys are supposed to be unique, it's possible (and rather likely now-a-days) that a computer has multiple NIC cards, but you can get at all of them with the WMI interface.
May 30 '07 #3
MAC address of NIC of your computer must be UNIQUE.

Following is the code to get the MAC address

//Requires a reference for System.Management

public string GetMACAddress()
{
ManagementObjectSearcher objMgmtSearcher;
ManagementObjectCollection objCollection;

objMgmtSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
objCollection = objMgmtSearcher.Get();

StringBuilder strTable = new StringBuilder();

strTable.Append("<table><tr><td>Caption</td><td>Mac Adddress</td></tr>");
foreach (ManagementObject objMgmt in objCollection)
{
strTable.Append("<tr><td>" + objMgmt["caption"].ToString() + "</td>");
if (objMgmt["MACAddress"] != null)
strTable.Append("<td>" + objMgmt["MACAddress"].ToString() + "</td>");
else
strTable.Append("<td>-</td>");
strTable.Append("</tr>");
}
strTable.Append("</table>");
return strTable.ToString();
}
May 30 '07 #4
Plater
7,872 Expert 4TB
The reason I didn't put much reliance on the MAC is that many pieces of hardware nowadays support MAC-spoofing and thus you can produce duplicate MACs (although if that happened the network structure would be compromised let alone your software)

But more over someone could keep changing their MAC and you would not be able to track them.

Also, old NIC cards can have issues and lose their MACs (yes it does happen, physical corrosion on the card itself can cause bits to stick and other hardware issues)
May 30 '07 #5
blossam
29
MAC address of NIC of your computer must be UNIQUE.

Following is the code to get the MAC address

//Requires a reference for System.Management

public string GetMACAddress()
{
ManagementObjectSearcher objMgmtSearcher;
ManagementObjectCollection objCollection;

objMgmtSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_NetworkAdapter");
objCollection = objMgmtSearcher.Get();

StringBuilder strTable = new StringBuilder();

strTable.Append("<table><tr><td>Caption</td><td>Mac Adddress</td></tr>");
foreach (ManagementObject objMgmt in objCollection)
{
strTable.Append("<tr><td>" + objMgmt["caption"].ToString() + "</td>");
if (objMgmt["MACAddress"] != null)
strTable.Append("<td>" + objMgmt["MACAddress"].ToString() + "</td>");
else
strTable.Append("<td>-</td>");
strTable.Append("</tr>");
}
strTable.Append("</table>");
return strTable.ToString();
}
hi, thanks for reply me and help me
May 31 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Martin Foster | last post: by
reply views Thread by amit | last post: by
reply views Thread by AMIT PUROHIT | last post: by
5 posts views Thread by Mike Labosh | last post: by
3 posts views Thread by David T. Ashley | last post: by
reply views Thread by Derek | last post: by
2 posts views Thread by samuelberthelot | last post: by

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.