T toli Unregistered / Unconfirmed GUEST, unregistred user! 2005-06-02 #1 我在linux下,想知道如何判断本机同某一IP地址(如:192.168.100.155)是否可以连接. 就像ping命令一样,不过是用程序判断? 谢谢!(我是在linux下面,用C语言写的程序)
T toli Unregistered / Unconfirmed GUEST, unregistred user! 2005-06-02 #2 我在linux下,想知道如何判断本机同某一IP地址(如:192.168.100.155)是否可以连接. 就像ping命令一样,不过是用程序判断? 谢谢!(我是在linux下面,用C语言写的程序)
F flyjimi Unregistered / Unconfirmed GUEST, unregistred user! 2005-06-12 #4 interface uses SysUtils, Classes, IdBaseComponent, IdComponent, IdTCPConnection, IdIcmpClient, IdTCPClient, IdRawBase, IdRawClient; function JudgePing(AServerName: PChar): Boolean;//这个是用来PIN计算机的. var ICMP: TIdIcmpClient; begin ICMP := TIdIcmpClient.Create(nil); ICMP.ReceiveTimeout := 1000; ICMP.Host := AServerName; try ICMP.Ping; Result := True; except Result := False; end; ICMP.Free; end;
interface uses SysUtils, Classes, IdBaseComponent, IdComponent, IdTCPConnection, IdIcmpClient, IdTCPClient, IdRawBase, IdRawClient; function JudgePing(AServerName: PChar): Boolean;//这个是用来PIN计算机的. var ICMP: TIdIcmpClient; begin ICMP := TIdIcmpClient.Create(nil); ICMP.ReceiveTimeout := 1000; ICMP.Host := AServerName; try ICMP.Ping; Result := True; except Result := False; end; ICMP.Free; end;
T toli Unregistered / Unconfirmed GUEST, unregistred user! 2005-06-13 #5 to flyjimi 我晕..... 有没有C代码,在linux下用的 谢谢