um einen namen im lokalen netzwerk umzuwandeln hab ich im EDH folgenden code gefunden:
Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| Uses WinSock;
FUNCTION GetIpAddressByName(const AComputerName: STRING): STRING; VAR TMPResult: STRING; WSA: TWSAData; H: PHostEnt; P: PChar; BEGIN IF WSAStartUp($101, WSA) = 0 THEN BEGIN GetMem(P,255 + 1); StrPCopy(P, ComputerName); H:=GetHostByName(P); FreeMem(P); IF H <> NIL THEN BEGIN P:=inet_ntoa(PInAddr(H^.h_addr_list^)^); TMPResult:=StrPas(P) END; WSACleanUp; IF TMPResult <> '' THEN Result:=TMPResult ELSE Result:= '0'; END; END; |
wenn du z.b. aaa.auq.de aufgelöst haben willst, dann ping doch einfach per INDY. dann bekommst du die IP zurück
_________________
In the beginning was the word.
And the word was content-type: text/plain.