IP address =>CString <=>u_long

开发环境:VS6.0

操作系统:XP2 

转换:

eg:

CString str_temp_ip = _T("192.168.0.200");

u_long = (u_long)htonl(inet_addr(str_temp_ip));

 

具体例子:

 

CString str_local_ip = _T("");
 str_local_ip = _T("192.168.1.102");
 u_long u_ip  = (u_long)htonl(inet_addr(str_local_ip));
 u_long u_ip_t = htonl(u_ip);
 u_long u_ip_t_t = ntohl(u_ip_t);

IP address =>CString <=>u_long_第1张图片

 

 

你可能感兴趣的:(XP)