如果有,是什么?
解决方案 »
- WebBrowser编程-自动提交问题,如何将Memo.Lines的内容赋给对象啊.提交后无法换行
- 在我查詢時,我用query.recordcount求記錄數時,怎麼得出的結果是-1呢。
- 用TTreeView编了似资源管理器的树形目录,顶层“我的电脑”图标怎样取到?100分!
- 嘘,不要告诉别人。
- 怎么用Combo.AddItem啊
- 如何得到汉字的拼音,500俸上,非常感谢大家的解答!!!!!
- 用delphi能实现接收器吗?怎么做?
- 在DELPHI中如何读出指定EXECL文件的行和列的总数?
- 企业即时通讯系统源代码销售
- Delphi7.0 的安装问题
- 请问如何判断edit的字符串是否为数字?
- 一个简单的问题,请进来吧
var
WSAData: TWSAData;
HostEnt: PHostEnt;
begin
Result := False;
WSAStartup(2, WSAData);
HostEnt := gethostbyname(PChar(ComputerName));
if HostEnt = nil then Result := False;
WSACleanup;
end;
http://delphijl.99898.com/delphier/article/ShowArticle.asp?ArticleID=18
或者写信给我:[email protected]
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, shellapi, Sockets, WInSock, IdBaseComponent,
IdComponent, IdRawBase, IdRawClient, IdIcmpClient;type
TMyPing = class(TForm)
Button1: TButton;
Button2: TButton;
Edit1: TEdit;
IdIcmpClient1: TIdIcmpClient;
ListBox1: TListBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure IdIcmpClient1Reply(ASender: TComponent;
const AReplyStatus: TReplyStatus); private
{ Private declarations }
public
{ Public declarations }
end;var
MyPing: TMyPing;implementation{$R *.dfm}procedure TMyPing.Button1Click(Sender: TObject);
var
i : integer;
begin
IdIcmpClient1.Host:= Edit1.Text; //宿主计算机的名称或IP地址
IdIcmpClient1.ReceiveTimeout:=1000; //最大等待时间
Button1.Enabled := false;
try
for i:=0 to 3 do //重复4次
begin
IdIcmpClient1.Ping('hello',0);
Application.ProcessMessages ; //延时
end;
finally
Button1.Enabled := true;
end;
end;procedure TMyPing.Button2Click(Sender: TObject);
begin
ListBox1.Clear ;
end;procedure TMyPing.IdIcmpClient1Reply(ASender: TComponent;
const AReplyStatus: TReplyStatus);
var
sTime: string;
begin
//检测Ping的回复错误
if (AReplyStatus.MsRoundTripTime = 0 ) then
sTime := '<1'
else
sTime := '=';
//在列表框中显示Ping消息
ListBox1.Items.Add(Format('Reply from [%s] : Bytes=%d time%s%d ms TTL=%d',
[AReplyStatus.FromIpAddress,
AReplyStatus.BytesReceived,
sTime,
AReplyStatus.MsRoundTripTime,
AReplyStatus.TimeToLive]));
end;
end.