Cita:
Empezado por Casimiro Notevi
.
Yo uso lo mismo con una pequeña variación y funciona perfectamente:
Código Delphi [-]function getIPnumber: string;
const
_MAXSIZE_ = 48;
var
buffer:Array [0.._MAXSIZE_+1] of char;
PuntHost: PHostEnt;
wVersionRequested: WORD;
wsaData: TWSAData;
begin
Result := '';
wVersionRequested := MAKEWORD( 1, 1 );
WSAStartup( wVersionRequested, wsaData );
GetHostName( @buffer, _MAXSIZE_ );
PuntHost := GetHostByName( @buffer );
Result := iNet_ntoa( PInAddr( PuntHost^.h_addr_list^ )^ );
WSACleanup;
end;
|
Ya use tu codigo y me vuelve a marcar el mismo error de Excepcion...
Por ese motivo, yo creo que debe ser un problema en el Build del Windows Server... ya que cuando lo ejecuto en Windows 7, 10 o 2012 Server funciona muy bien...