開發環境: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);