日期:2014-05-18 浏览次数:20529 次
int[] GetIPValue(int IPNumber) { int[] ipValue = new int[4]; ipValue[0] = (int)(IPNumber / Math.Pow(256,3)); ipValue[1] = (int)((IPNumber - Math.Pow(256, 3) * ipValue[0]) / Math.Pow(256, 2)); ipValue[2] = (int)((IPNumber - Math.Pow(256, 3) * ipValue[0] - Math.Pow(256, 2) * ipValue[1]) / 256); ipValue[3] = (int)(IPNumber - Math.Pow(256, 3) * ipValue[0] - Math.Pow(256, 2) * ipValue[1] - 256 * ipValue[2]); return ipValue; }