i needed to find out what part of the world an ip addresss came from for my proxy checker In the most widely installed level of the Internet Protocol (IP) today, an IP address is a 32-bit number that identifies each sender or receiver of information that is sent in packets across the Internet. The IP address is usually expressed as four decimal numbers, each representing eight bits, separated by periods. This is sometimes known as the dot address and, more technically, as dotted quad notation. For example, 127.0.0.1 could be an IP address. The IP Number is the single word (long) notation of an IP Address as it is being used in the database because it is efficient to search between a range of numbers in database.
public int GenerateIpNumber(string Ip)
{
string[] split = Ip.Split('.');
int ipnum = Convert.ToInt32(split[0]) * (256 * 256 * 256) + Convert.ToInt32(split[1]) * (256 * 256) + Convert.ToInt32(split[2]) * 256 + Convert.ToInt32(split[3]);
return ipnum;
}