当前位置:编程学习 > C#/ASP.NET >>

从c++ .dll接收到的unsigned long IP地址如何在C#中转换成*.*.*.*?

如题求解

如何实现IP地址的互相转换

--------------------编程问答-------------------- 自己顶一顶。 --------------------编程问答-------------------- byte[] b = BitConverter.GetBytes(data);//假设data就是192.168.0.1
string s = string.Format("{0}.{1}.{2}.{3}", b[4], b[5], b[6], b[7]);
为啥不是uint --------------------编程问答--------------------
IPAddress ip = new IPAddress(ipValue);
Console.WriteLine(ip.ToString());
--------------------编程问答--------------------
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,