[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!
using (var client = new WebServiceClient(42, "license_key"))
// Do the lookup
var response = client.Country("18.104.22.168");
Console.WriteLine(response.Country.IsoCode); // 'US'
Console.WriteLine(response.Country.Name); // 'United States'
Console.WriteLine(response.Country.Names["zh-CN"]); // '美国'
Open in new window
protected string GetIPAddress()
System.Web.HttpContext context = System.Web.HttpContext.Current;
string ipAddress = context.Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
string addresses = ipAddress.Split(',');
if (addresses.Length != 0)
Error 13 The type or namespace name 'WebServiceClient' could not be found (are you missing a using directive or an assembly reference?)
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.