IP地址整型与格式化字符串转换

IPAddress   ip   =   IPAddress.Parse("59.32.0.0");  
  byte[]   bip   =   ip.GetAddressBytes();  
  uint   a   =   BitConverter.ToUInt32(bip,   0);  
  a   ^=   (uint)Math.Pow(2,   8);  
  ip   =   new   IPAddress(a);  
  Console.Write(ip.ToString());  
   
  结果:59.33.0.0
posted @ 2007-07-27 17:25  jambol  阅读(1479)  评论(1编辑  收藏  举报