CString strIP="192.168.1.184";   

DWORD dwAddress= ntohl( inet_addr(strIP));   

m_IPAddr.SetAddress(dwAddress);

//---------------------------------------

DWORD dwMainServerIP;
m_MainServerIPCtrl.GetAddress(dwMainServerIP);
strMainServerIP.Format(_T("%d.%d.%d.%d"),
(dwMainServerIP>>24)&0xff,
(dwMainServerIP>>16)&0xff,
(dwMainServerIP>>8)&0xff,
dwMainServerIP&0xff ) ;

VC++ 将IP字符串转为 DWORD值的更多相关文章

  1. [LeetCode] String to Integer (atoi) 字符串转为整数

    Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. ...

  2. Swift3.0语言教程字符串转换为数字值

    Swift3.0语言教程字符串转换为数字值 Swift3.0语言教程字符串转换为数字值,在NSString中,开发者可以将字符串转换为数字值,通过这些数字值可以实现一些功能,如加法运算.减法运算等.数 ...

  3. [C++] zlatlcv: ATL字符串转换辅助库。能很方便的将UTF-8字符串转为TCHAR等字符串

    作者:zyl910 如今,UTF-8字符串的使用频率越来越多了.但是在VC中,不能直接处理UTF-8字符串,得专门去写UTF-8与窄字符串.宽字符串.TCHAR字符串相互转换的代码.不仅费时费力,而且 ...

  4. json格式的字符串转为json对象遇到特殊字符问题解决

    中午做后台发过来的json的时候转为对象,可是有几条数据一直出不来,检查发现json里包含了换行符,造成这种情况的原因可能是编辑部门在编辑的时候打的回车造成的 假设有这样一段json格式的字符串 va ...

  5. SpringMVC空字符串转为null

    空字符串转为null 现在我遇到这样一个需求,那就是我想要吧前端传过来的值变为空,因为所谓前端的校验,其实都不是校验,如果前端传给后台一个表单,可是表单未填入值,我们后台进行判断的时候 既需要判断nu ...

  6. [LeetCode] IP to CIDR 将IP地址转为CIDR无类别域间路由

    Given a start IP address ip and a number of ips we need to cover n, return a representation of the r ...

  7. POI导出复杂的excel;excel公共样式类;excel拼接定制类;数据科学计数法转为普通值

    一.excel公共样式类(包含数据科学计数法转为普通值) package com.thinkgem.jeesite.common.utils.excel; import org.apache.poi. ...

  8. Leetcode题库——8.字符串转为整数【##】

    @author: ZZQ @software: PyCharm @file: myAtoi.py @time: 2018/9/20 20:54 要求:实现 atoi,将字符串转为整数. 1)根据需要丢 ...

  9. 把IP字符串转换为IPv4标准格式

    把IP字符串转换为IPv4标准格式,如一个IP为127.0.0.1转为127.000.000.001格式? 即是说“点”分隔的数据不够三位数字长度,转换为三位数字长度. Insus.NET有尝试写了一 ...

随机推荐

  1. 转: MySQL 赋予用户权限(grant %-远程和localhost-本地区别)

    相关参考资料: MySQL 赋予用户权限命令的简单格式可概括为: grant 权限 on 数据库对象 to 用户 一.grant 普通数据用户,查询.插入.更新.删除 数据库中所有表数据的权利. gr ...

  2. Codeforces 733F Drivers Dissatisfaction

    题意:有n个点,m条边,每条边有不满意度w[i],以及减小一个不满意度代价c[i],问给你s元用来减少代价,找到一个总不满意度最小的生成树,保证有解.(减少后的不满意度可以为负数)思路:显然所有的钱都 ...

  3. Android项目——读取手机联系人信息

    加入读取联系人信息的权限 <uses-permission android:name="android.permission.READ_CONTACTS"/> cont ...

  4. HTML5 history新特性pushState、replaceState,popstate

    http://blog.csdn.net/tianyitianyi1/article/details/7426606 https://developer.mozilla.org/zh-CN/docs/ ...

  5. windows环境下局域网内无法访问apache站点

    DocumentRoot "D:/wamp/www/" <Directory />     AllowOverride none     order deny,allo ...

  6. thrift demo

    基于上一篇博客,安装thrift complier之后,就需要进行跑跑程序,来看看是否如同预期的那种效果. 前面的thrift compiler的主要作用,其实就是为了IDL的,就是防止客户端和服务端 ...

  7. [Hibernate] - Generic Dao

    使用泛型写了一个通用的Hibernate DAO类. GenericDao接口 package com.my.dao; import java.io.Serializable; import java ...

  8. view抖动效果

    1.使用属性动画 ViewPropertyAnimator.animate(webView).translationX(20).setInterpolator(new CycleInterpolato ...

  9. ModelAttribute注解

    1.使用@ModelAttribute标记方法,会在每个目标方法执行前被springMVC调用 2.使用@ModelAttribute修饰目标方法pojo入参,其value属性值有以下作用: 1)sp ...

  10. delphi 调用c#dll

    public interface iProduct { string Buy(); } [ClassInterface(ClassInterfaceType.None)] public class P ...