Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #8  
Antiguo 07-10-2010
migvaz5 migvaz5 is offline
Registrado
 
Registrado: abr 2005
Posts: 4
Poder: 0
migvaz5 Va por buen camino
Obtencion Mac

Miren encontre un link donde esxplica como obtener la direccion mac
espero les sirva

Aclaro
Lo encontre en una pagina de internet.
Pascal and Delphi Code Snippet
  1. uses NB30;
  2. function GetAdapterInfo(Lana: Char): String;
  3. var
  4. Adapter: TAdapterStatus;
  5. NCB: TNCB;
  6. begin
  7. FillChar(NCB, SizeOf(NCB), 0);
  8. NCB.ncb_command := Char(NCBRESET);
  9. NCB.ncb_lana_num := Lana;
  10. if Netbios(@NCB) <> Char(NRC_GOODRET) then
  11. begin
  12. Result := 'mac not found';
  13. Exit;
  14. end;
  15. FillChar(NCB, SizeOf(NCB), 0);
  16. NCB.ncb_command := Char(NCBASTAT);
  17. NCB.ncb_lana_num := Lana;
  18. NCB.ncb_callname := '*';
  19. FillChar(Adapter, SizeOf(Adapter), 0);
  20. NCB.ncb_buffer := @Adapter;
  21. NCB.ncb_length := SizeOf(Adapter);
  22. if Netbios(@NCB) <> Char(NRC_GOODRET) then
  23. begin
  24. Result := 'mac not found';
  25. Exit;
  26. end;
  27. Result :=
  28. IntToHex(Byte(Adapter.adapter_address[0]), 2) + '-' +
  29. IntToHex(Byte(Adapter.adapter_address[1]), 2) + '-' +
  30. IntToHex(Byte(Adapter.adapter_address[2]), 2) + '-' +
  31. IntToHex(Byte(Adapter.adapter_address[3]), 2) + '-' +
  32. IntToHex(Byte(Adapter.adapter_address[4]), 2) + '-' +
  33. IntToHex(Byte(Adapter.adapter_address[5]), 2);
  34. end;
  35. function GetMACAddress: string;
  36. var
  37. AdapterList: TLanaEnum;
  38. NCB: TNCB;
  39. begin
  40. FillChar(NCB, SizeOf(NCB), 0);
  41. NCB.ncb_command := Char(NCBENUM);
  42. NCB.ncb_buffer := @AdapterList;
  43. NCB.ncb_length := SizeOf(AdapterList);
  44. Netbios(@NCB);
  45. if Byte(AdapterList.length) > 0 then
  46. Result := GetAdapterInfo(AdapterList.lana[0])
  47. else
  48. Result := 'mac not found';
  49. end;
  50. // usage
  51. procedure TForm1.Button1Click(Sender: TObject);
  52. begin
  53. ShowMessage(GetMACAddress);
  54. end;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 06:28:16.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi