Fórum Como pegar o IP de uma máquina. #194844
13/11/2003
0
Quando o programa é aberto Pega o IP da Máquina que o abriu e compara com uma lista de IPs cadastrados no Banco.
Agradeço se alguém puder ajudar.
Mkoch
Curtir tópico
+ 0Posts
13/11/2003
Luizfernando777
var
WSAData: TWSAData;
HostEnt: PHostEnt;
Name:string;
begin
WSAStartup(2, WSAData);
SetLength(Name, 255);
Gethostname(PChar(Name), 255);
SetLength(Name, StrLen(PChar(Name)));
HostEnt := gethostbyname(PChar(Name));
with HostEnt^ do
begin
Result := Format(´¬d.¬d.¬d.¬d´,
[Byte(h_addr^[0]),Byte(h_addr^[1]),
Byte(h_addr^[2]),Byte(h_addr^[3])]);
end;
WSACleanup;
end;
Gostei + 0
13/11/2003
Sam
var
WSAData: TWSAData;
HostEnt: PHostEnt;
Name:string;
begin
WSAStartup(2, WSAData);
SetLength(Name, 255);
Gethostname(PChar(Name), 255);
SetLength(Name, StrLen(PChar(Name)));
HostEnt := gethostbyname(PChar(Name));
with HostEnt^ do
Result:=Format(´¬d.¬d.¬d.¬d´,[Byte(h_addr^[0]),
Byte(h_addr^[1]),Byte(h_addr^[2]),Byte(h_addr^[3])]);
WSACleanup;
end;
Gostei + 0
13/11/2003
Mkoch
Se precisar de algo é só teclar.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)