我已知了一个IP地址,在局域网中如何知道此IP地址的机器是否连接在局域网中(有放火墙的哟),我尝试用Ping命令,它返回值认为不在网,可实质是在的呀,所以请求其他方法。谢谢了。
解决方案 »
- 请教高手 希望大家能进来帮我解决 谢谢!
- 在线等:如何更改任务栏中的图标提示,它默认的提示是"ICON"
- 狂晕,狂晕,狂晕,狂晕,
- 操作EXCEL问题!!!(在线等)
- 读取IMAGE类型的字段速度非常缓慢?(附代码)(
- 关于idhttp的一个简单问题
- inner join后的ON 是什么意思,AND 又是什么意思一个INNER JOIN后可以跟多少个ON
- 高分问Inno Setup两个问题:
- 怎样把TXT里的内容导入ACCESS数据库
- 这个有关DELPHI编程的问题或许不是太难--进来看看吧!
- 如何在Combobox的下拉列表中显示从数据库中提取的多个字段的内容
- 第三方控件无法使用!!救火阿!
var
ipaddress:dword;
hos:phostent;begin
ipaddress:= inet_addr(PChar(strip));
hos:=gethostbyaddr(@ipaddress,sizeof(ipaddress),PF_INET);
if hos<>nil then ShowMessage( 'The Computer Named '''+hos.h_name+''' is Online')
else
begin
case wsagetlasterror of
WSANOTINITIALISED:
ShowMessage('A successful WSAStartup must occur before using this function.');
WSAENETDOWN:
ShowMessage('The network subsystem has failed.');
WSAHOST_NOT_FOUND:
ShowMessage('Authoritative Answer Host not found.');
WSATRY_AGAIN:
ShowMessage('Non-Authoritative Host not found, or server failed.');
WSANO_RECOVERY:
ShowMessage('Nonrecoverable error occurred.');
WSANO_DATA:
ShowMessage('The Computer is Offline.');
//ShowMessage('Valid name, no data record of requested type.');
WSAEINPROGRESS:
ShowMessage('A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.');
WSAEAFNOSUPPORT:
ShowMessage('The type specified is not supported by the Windows Sockets implementation.');
WSAEFAULT:
ShowMessage('The addr argument is not a valid part of the user address space, or the len argument is too small.');
WSAEINTR:
ShowMessage('The (blocking) call was canceled through WSACancelBlockingCall.');
end;
end;end;
我试过了,可怎么返回都是为空?我用Ping命令还有些是连接成功的哟。好奇怪的也