GARANTIR DESCONTO

Fórum Dúvida pegar Mac Adress #357318

18/04/2008

0

estou com dúvida nesse código pra pegar MAC , quem puder ajudar fico grato !

function MacAddress: string;
var
Lib: Cardinal;
Func: function(GUID: PGUID): Longint; stdcall;
GUID1, GUID2: TGUID;
begin
Result := ´´;
Lib := LoadLibrary(´rpcrt4.dll´);
if Lib <> 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;


essa parte de comparação q ele faz é de q com oq ?
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])


seria por acaso o valor do MAC na DLL com o valor do MAC na placa de rede e verifica se batem um com o outro ?
valeu galera :wink:


Psyjacko

Psyjacko

Responder

Posts

22/04/2008

Psyjacko

up up up !
ajuda ae galera !!


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar