解析ICMP的ping命令代码(1)
解析ICMP的ping命令代码(1)
在ICMP的应用中,我们可以使用ping命令来进行操作。本文就是介绍了这部分的应用。介绍了具体实现的代码。希望对大家学习ICMP有所帮助。
原理简介:
这个例子演示了应用微软的ICMP.DLL怎样"ping"另一台机器. 这个DLL是没有文档话的发送ICMP回送包API接口, 也称为"pings," 就像潜水员对声纳信号的术语一样. 这段代码出自一个被一个名叫MarkG的家伙的GUI程序, 他的网页已经消失了.
ICMP.DLL API 现在在Windows平台上与微软的Winsocks工作的很好, 但是微软说更好的产品一出来他们将替换它. 微软说这个自从Windows 95时代就在用, 这些功能在在Windows 2000上仍然存在.
For more information on the ICMP.DLL API, check out sockets.com's ICMP API page.
更详细的ICMP.DLL API的信息到sockets.com的ICMP API网页获取.
- 具体实现:
- --------
- // Borland C 5.0: bcc32.cpp ping.cpp
- // Visual C 5.0: cl ping.cpp wsock32.lib
- //
- // This sample program is hereby placed in the public domain.
- #include <iostream.h>
- #include <winsock.h>
- #include <windowsx.h>
- #include "icmpdefs.h"
评论暂时关闭