Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get MAC address in windows7?
    text
    copied!<blockquote> <p><strong>Possible Duplicates:</strong><br> <a href="https://stackoverflow.com/questions/2069855/getting-machines-mac-address-good-solution">Getting Machine&rsquo;s MAC Address &mdash; Good Solution?</a><br> <a href="https://stackoverflow.com/questions/577071/how-do-i-get-the-mac-address-of-a-network-card-using-delphi">How do I get the MAC address of a network card using Delphi?</a> </p> </blockquote> <p>I am using MAC address as hardware id for protection(ofcourse I have encrypted this data) I am using below code to get MAC address on user computer </p> <pre><code>function MacAddress: string; var Lib: Cardinal; Func: function(GUID: PGUID): Longint; stdcall; GUID1, GUID2: TGUID; begin Result := ''; Lib := LoadLibrary('rpcrt4.dll'); if Lib &lt;&gt; 0 then begin @Func := GetProcAddress(Lib, 'UuidCreateSequential'); if Assigned(Func) then begin if (Func(@GUID1) = 0) and (Func(@GUID2) = 0) and (GUID1.D4[2] = GUID2.D4[2]) and (GUID1.D4[3] = GUID2.D4[3]) and (GUID1.D4[4] = GUID2.D4[4]) and (GUID1.D4[5] = GUID2.D4[5]) and (GUID1.D4[6] = GUID2.D4[6]) and (GUID1.D4[7] = GUID2.D4[7]) then begin Result := IntToHex(GUID1.D4[2], 2) + '-' + IntToHex(GUID1.D4[3], 2) + '-' + IntToHex(GUID1.D4[4], 2) + '-' + IntToHex(GUID1.D4[5], 2) + '-' + IntToHex(GUID1.D4[6], 2) + '-' + IntToHex(GUID1.D4[7], 2); end; end; end; end; </code></pre> <p>above code works perfectly on windows XP but its giving different values in windows7 ,the value changing every time after computer resratred :( is there any chance of getting MAC address thats constant (unless user changed his MAC address) or is there any good code which retrvies constant data on all OS ?</p> <p>thanks in advance </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload