![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
||||
|
||||
|
#2
|
|||
|
|||
|
Cita:
|
|
#3
|
||||
|
||||
|
Ya podías haber dicho que el código es de nuestro querido amigo Seoane, un grande entre los grandes
![]()
__________________
La otra guía de estilo | Búsquedas avanzadas | Etiquetas para código | Colabora mediante Paypal |
|
#4
|
|||
|
|||
|
Mea culpa
Mea culpa !!!gracias a todos. |
|
#5
|
||||
|
||||
|
Espero que resuelvas pronto el problemita
![]()
__________________
La otra guía de estilo | Búsquedas avanzadas | Etiquetas para código | Colabora mediante Paypal |
|
#6
|
|||
|
|||
|
Gracias a seoane ya pude hacer funcionar el codigo, hay partes que no controlo asi que me toca "romperlas" y estudiarlas, por cierto muestro el código en su totalidad ya funcionando:
Código Delphi [-]unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, winsock, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Label1: TLabel; Edit1: TEdit; Label2: TLabel; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; type PULONG = ^ULONG; var Form1: TForm1; implementation {$R *.dfm} function SendARP(DestIP,SrcIP: in_addr; pMacAddr,PhyAddrLen: PULONG): DWORD; stdcall; external 'iphlpapi.dll' name 'SendARP'; function ObtenerMAC(IP: Ansistring): Ansistring; var i: Integer; dwRetVal: DWORD; DestIp, SrcIp: in_addr; MacAddr: array[0..1] of ULONG; PhysAddrLen: ULONG; PhysAddr: PByte; begin DestIp.S_addr:= 0; SrcIp.S_addr:= 0; PhysAddrLen:= 6; DestIp.S_addr:= inet_addr(PAnsiChar(AnsiString(IP))); dwRetVal:= SendARP(DestIp, SrcIp, @MacAddr, @PhysAddrLen); Result:= EmptyStr; if dwRetVal = NO_ERROR then begin PhysAddr:= PByte(@MacAddr); for i := 1 to Sizeof(MacAddr)-2 do begin if Result= EmptyStr then Result:= IntToHex(PhysAddr^,2) else Result:= Result + '-' + IntToHex(PhysAddr^,2); inc(PhysAddr); end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin label1.Caption:=ObtenerMAC(edit1.Text); end; end. Como veis le añadir un campo edit + 2 label y un botón, gracias a todos. |
|
#7
|
|||
|
|||
|
Vaya, no se mostró bien a ver ahora
|
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Cómo averiguar el PID de un proceso | Ðαяισš | Varios | 20 | 01-01-2009 01:35:33 |
| Averiguar propiedades de pc | D@byt | Varios | 3 | 05-10-2005 17:13:06 |
| Averiguar equipos en red | salvanano | Internet | 3 | 02-09-2005 00:44:02 |
| averiguar codigos | unko! | Internet | 11 | 03-02-2005 02:51:57 |
| Averiguar estructura de frm | brandolin | MySQL | 0 | 20-10-2003 22:23:57 |
|