BF2Statistics.Net.Networking.LongToIP C# (CSharp) Method

LongToIP() public static method

Converts a long to an IP Address
public static LongToIP ( long longIP ) : string
longIP long
return string
        public static string LongToIP(long longIP)
        {
            string ip = string.Empty;
            for (int i = 0; i < 4; i++)
            {
                int num = (int)(longIP / Math.Pow(256, (3 - i)));
                longIP = longIP - (long)(num * Math.Pow(256, (3 - i)));
                if (i == 0)
                    ip = num.ToString();
                else
                    ip = ip + "." + num.ToString();
            }
            return ip;
        }