获得IP地址中文

string ipFilePath = @"~/App_Data/QQWry.dat";
QQWryLocator QQWry = new QQWryLocator(Server.MapPath(ipFilePath));
IPLocation loc = QQWry.Query(ip);
string country = loc.Country;
foreach (DataRow dr in ds.Tables[0].Rows)
{
if (country.Contains(dr["CityName"].ToString()))
{
Session["CityOrg"] = dr["CityOrg"].ToString();
Session["CityID"] = dr["CityID"].ToString();
}
}
Session["oip"] = string.Format("{0}and {1}", loc.Country, loc.Local);
Session.Timeout = 4;

原文地址:https://www.cnblogs.com/woloveprogram/p/4720323.html