请问如何用VC实现PING的功能? 不是DOS下的那种。具体要引用哪些头文件,方法怎么实现?谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 windows网络编程技术 书里边有 为什么回复的都是《windows网络编程技术》书里有为书做广告? CPing -- Easily ping a host from Windows 95 and Windows NT http://www.codeguru.com/internet/cping.shtml IP Address Swapping http://www.codeguru.com/internet/ipswap.html A New Way to Ping http://www.codeguru.com/internet/NewPing.html Exploring Trace Routes http://www.codeguru.com/internet/TraceRoutes.html 另外这本书上也有Windows网络与通信程序设计还有baidu,google肯定有因为我之前找过 为什么回复的都是《windows网络编程技术》书里有----------------------------------------------因为这本书里的确有 P124页开始 不过楼主最好在这个基础上写:#include "stdafx.h"#include <iostream> #include <stdlib.h>#include <string> #include <winsock2.h>#include <winsock.h>using namespace std;#pragma comment(lib,"Iphlpapi.lib")#pragma comment(lib,"ws2_32")class Pet { public: virtual ~Pet(){}}; int _tmain(int argc, _TCHAR* argv[]){ WSADATA WSAData; if (WSAStartup(MAKEWORD(2,2),&WSAData)!=0) { printf("WSAStartup error.Error:%d\n",WSAGetLastError()); return 0; } cin.ignore(); return 0;}这个好像书上没写^_^ class Pet { public: virtual ~Pet(){}};这句话没用 你搜索下ICMP 然后改写下就成就用到了原始套界字的 + ICMP也可以用他提供的ICMP.DLL 为什么回复的都是《windows网络编程技术》书里有----------------------------------------------因为这本书里的确有 随便google下也能找到代码...SDK下都有直接的例子 MFC对话框关闭的时候弹出一个消息框这个该如何做到?送分题 如何在static控件上不停的显示数字1-10? vc++编译总死 怎样实现捕获网页上的全部链接呢? 怎样才能随心所欲地定位CEdit子类的输入指示器?SetCaretPos好像没用呀! 怎样用API函数? 有关TAPI的简单问题 如何在程序中判断CTRL和ENTER键同时按下??? 如何在vc中使用vb中的FileSystemObject? 如何用代码设置某个Button为默认按钮 在线:WaitCommEvent不能正常返回怎么回事? 一个关于MSDN中CButton::DrawItem()函数中的问题
为书做广告?
http://www.codeguru.com/internet/cping.shtml
IP Address Swapping
http://www.codeguru.com/internet/ipswap.html
A New Way to Ping
http://www.codeguru.com/internet/NewPing.html
Exploring Trace Routes
http://www.codeguru.com/internet/TraceRoutes.html
因为我之前找过
----------------------------------------------
因为这本书里的确有
P124页开始
#include "stdafx.h"
#include <iostream>
#include <stdlib.h>
#include <string>
#include <winsock2.h>
#include <winsock.h>
using namespace std;
#pragma comment(lib,"Iphlpapi.lib")
#pragma comment(lib,"ws2_32")class Pet { public: virtual ~Pet(){}};
int _tmain(int argc, _TCHAR* argv[])
{ WSADATA WSAData;
if (WSAStartup(MAKEWORD(2,2),&WSAData)!=0)
{
printf("WSAStartup error.Error:%d\n",WSAGetLastError());
return 0;
}
cin.ignore();
return 0;
}这个好像书上没写^_^
这句话没用
就用到了原始套界字的 + ICMP
也可以用他提供的ICMP.DLL
----------------------------------------------
因为这本书里的确有