How to get a computer id?

Is there any code in vb.net or java to get the computer id β†’ I want to write a program that could get a computer ID to license a software like microsoft?

Thanks in advance

Makar

+3
source share
2 answers

First, Microsoft licensing does not work this way.

They have a key that is generated on their side of things. When they sell you a copy of the software, they give you the key. After entering the key, the software sends some encrypted tcp packets back to MS to determine that the key is now in use and increase the amount of use. Then it creates a beautifully hidden file on your system that contains the authorization for this key.

None of this is related to obtaining a "computer ID".

Now MS (for at least one of its licensing models) takes a snapshot of the system, which includes the processor type, hard drive and make / model motherboard, to determine if the components have been changed so as to cause a potential check if check computer license.

This brings us back to the idea that there is not a single β€œidentifier” in a computer system. The last time this was done, Intel was using (in my opinion?) Its PII processors. However, public recall was enough that they stopped putting serial numbers on the chip.

The next closest thing you can do is try and read the MAC address; but network cards often change so much that it is littered with traps.

I would highly recommend that you explore other mechanisms for executing license keys, if that is really what you want.

+7
source

You can use this function, it will return the mac address:

public String macname() throws IOException { String mac = "null"; String[] getmac = new String[] { "cmd", "/c", "getmac /NH" }; Process pnew = Runtime.getRuntime().exec(getmac); BufferedReader newin = new BufferedReader(new InputStreamReader( pnew.getInputStream())); String line1 = ""; String ab = ""; while ((line1 = newin.readLine()) != null) { ab = ab + line1; } int in = ab.indexOf(' '); mac = ab.substring(0, in); return mac; } 
+2
source

Source: https://habr.com/ru/post/896211/


All Articles