Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #12  
Antiguo 07-07-2012
barakuda barakuda is offline
Miembro
 
Registrado: mar 2010
Posts: 79
Poder: 17
barakuda Va por buen camino
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.
Responder Con Cita
 



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

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


La franja horaria es GMT +2. Ahora son las 20:36: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