ICMP协议仿真C++代码,// TODO: Add your command handler code here
if (IsRun)
{
MessageBox("网络监测时,不能网段探测!","提示");
return;
}
CNetIpDlg dlg;
if(dlg.DoModal()==IDOK)
{
char temp[64];
sprintf(temp,"%s.1",dlg.m_IP);
DWORD ip=0;
if(CUserDlg::IsValidIp(temp))
{
ip = CUserDlg::IpToNum(temp);
}else
{
MessageBox("IP地址格式错误!","提示");
return;
}
ip&= 0xffffff00;
int i;
if(Ping_Star(GetSafeHwnd(),TRUE))
for(i=1;i<255;i++)
{
SendPing(ip+i,16,0);
}
}
2021-12-01 19:13:43
1.01MB
ICMP
1