IP address Check
来源:互联网 发布:电脑网络接口类型 编辑:程序博客网 时间:2024/05/20 23:02
typedef union MultiByteStruct {//IP地址联合体 int iInt; //int有符号整型 float fFloat; //浮点数 UINT uInt; //无符号整数 ULONG uLong; //ULONG无符号整型 DWORD dwDword; //DWORD有符号整型 WORD wWord[2]; //WORD无符号整型数组 UCHAR ucByte[4]; //无符号字符数组 char cByte[4]; //字符数组 }UNIONIP,*PUNIONIP; //将字符串类型转为UINT类型 UINT IPStrToInt(CString IPStr) { UNIONIP IP; int i,j=0; IPStr.TrimLeft(_T(" ")); IPStr.TrimRight(_T(" ")); for (i=0;i<IPStr.GetLength();i++) { if (IPStr.GetAt(i) <_T('0') || IPStr.GetAt(i)>_T('9')) if (IPStr.GetAt(i) == _T('.')) j++; else return 0; } if (j!=3) { if (!m_IpSourceWay){MessageBox(_T("配置的IP地址格式不正确"));}return 0; }i=0;IPStr += _T(".");CString temp;for (int m=0;m<4;m++) {temp = _T("");while (IPStr.GetAt(i) != _T('.')) { temp+=IPStr.GetAt(i); i++; } i++;if (temp=="" || (UCHAR)wcstoul(temp,NULL,10) > 0xFF) {if (!m_IpSourceWay){MessageBox(_T("配置的IP地址格式不正确")); }return 0; } else IP.ucByte[m] = (UCHAR)wcstoul(temp,NULL,10); }return ntohl(IP.uInt); }
0 0
- check ip address
- IP address Check
- How to check ip address in linux
- check MAC Address Validation
- IP address
- ip address
- IP Address
- IP Address
- IP Address
- IP Address
- How to check ip address in linux
- check-ip
- get ip address & mac address
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address)
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- 2014年阿里巴巴9月14号笔试题
- POJ 2886 Who Gets the Most Candies?
- Activity存储结构变化:从Android2.3到Android4.4
- rm: cannot remove `/home/cn0000/log/formlog.20140417': Read-only file system
- 使用gradle打包jar包
- IP address Check
- 中国最火开博啦~~~
- W5100常见问题汇总
- 矩陣入門 poj 3735
- 在DWR中调用Http Servlet 对象
- 【字符 BF 和 KMP算法】
- uboot中背光的启动参数传递
- [MFC]Radio Button 控件使用小结
- IIS6.0+Tomcat7.0整合总结