mfc IP控件ip地址转unsigned long和unsigned long转char*
2014-05-29 14:19
405 查看
<pre name="code" class="cpp"> BYTE nField0 = 0, nField1 = 0, nField2 = 0, nField3 = 0; UpdateData(true); CString ipaddr; if(!m_zhongip.IsBlank()) { m_zhongip.GetAddress(nField0, nField1, nField2, nField3); ipaddr.Format(_T("%d.%d.%d.%d"), nField0, nField1, nField2, nField3); zhongip.ip=inet_addr(ipaddr); /* unsigned long ulAddr = zhongip.ip; in_addr inaddr; inaddr.s_addr=ulAddr; char* pAddr = inet_ntoa(inaddr); */ } else { AfxMessageBox("请输入IP地址!"); return; } if(nField0==0||nField3==0) { AfxMessageBox("您输入的不是有效IP地址"); return; }
相关文章推荐
- 获取本地IP地址,并在IP CONTROL控件中显示出来
- 获取MFC中CIPAddressCtrl类IP控件的值
- VC++ MFC编程中 IP控件的使用
- MFC的IP控件的使用,获取本地IP显示到控件
- MFC控件 CIPAddressCtrl
- 利用MFC进行IP地址控件的绘制
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- CIPAddressCtrl控件之IP地址与CString的互相转化
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- IP ADDRESS CONTROL-地址控件的使用 MFC
- 将unsigned long类型数据转成CString类型的IP数据
- 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中IP控件的使用方法(转载的文章)
- MFC IP Control 控件 BYTE转char *
- ipHeader.Version_HLen=(4<<4|sizeof(ipHeader)/sizeof(unsigned long))的解释
- MFC控件使用说明(combo box Button Check Box Radio Button List Control Edit Box Hot Key IP Address....)
- VC++ MFC 编程中 IP 控件的使用
- unsigned long整型数字转化成IP地址的实现
- 字符串转unsigned long(IP转 unsigned long)