델파이 로컬 IP 가져오기 썸네일형 리스트형 로컬 IP 가져오기 function TForm1.GetLocalAddress:string; var wsaData : TWSAData; slocal : array[0..255] of AnsiChar; phos : PHostEnt; addr : PChar; begin Result := ''; if (WSAStartup(MAKEWORD(1, 1), wsaData) 0) then exit; if (gethostname(slocal, sizeof(slocal)) = SOCKET_ERROR) then exit; phos := gethostbyname(slocal); if phos = nil then exit; addr := PChar(phos.h_addr_list^); Result := inet_ntoa(PInAddr(addr)^);.. 이전 1 다음