注册 登录
编程论坛 Delphi论坛

[求助]看看这个出了什么问题了

potato182 发布于 2006-08-17 17:09, 489 次点击

procedure TForm1.gethostbynameClick(Sender: TObject);
var
cr:string;
err:integer;
host:hostent;
op:pchar;
begin
host:=gethostbyname(pchar(edit1.Text));
except
if host=NIL then
begin
edit2.Text:='host does not exit';
exit;
end;
cr:=copy('host.h_addr',4,0 );
edit3.Text:=format('%d.%d.%d.%d',[ord(cr[1]),ord(cr[2]),ord(cr[3]),ord(cr[4])]);
edit2.Text:=host.h_name;


end;

1 回复
#2
luinsoft2006-08-31 17:52
你没try
1