1) 2) 5) y 6)
Código Delphi
[-]
uses Nb30, Winsock;
procedure TForm1.Button1Click(Sender: TObject);
type
ASTAT = record
adapt: TAdapterStatus;
NameBuff: Array[0..29] Of TNameBuffer;
end;
var
Adaptador: ASTAT;
Ncb: TNCB;
Nombre: String;
DatosSocket: WSAData;
BloqueIP: PHostEnt;
DirIP: in_addr;
begin
with Ncb Do begin ncb_command := char(NCBASTAT);
ncb_lana_num := char(0); ncb_callname := '*'; ncb_buffer := @Adaptador; ncb_length := sizeof(Adaptador); end;
Netbios(@Ncb);
with Adaptador.adapt Do
ShowMessage('La dirección MAC es: ' +
IntToHex(Integer(adapter_address[0]), 2) +
IntToHex(Integer(adapter_address[1]), 2) +
IntToHex(Integer(adapter_address[2]), 2) +
IntToHex(Integer(adapter_address[3]), 2) +
IntToHex(Integer(adapter_address[4]), 2) +
IntToHex(Integer(adapter_address[5]), 2));
WSAStartup($0101, DatosSocket); SetLength(Nombre, MAX_PATH); gethostname(PChar(Nombre), MAX_PATH);
BloqueIP := gethostbyname(PChar(Nombre));
CopyMemory(@DirIP, (BloqueIP^).h_addr_list^, BloqueIP.h_length);
ShowMessage(inet_ntoa(DirIP)); end;
Para los demás, mira por favor este truco de nuestro amigo seoane
http://www.clubdelphi.com/trucos/index.php?id=372
Creo que con esto, lo tenes resuelto
Saludos
__________________
Código Delphi
[-]
try
ProgramarMicro(80C52,'Intel',MnHex,True);
except
On Exception do
MicroChip.IsPresent(True);
end;