-
Notifications
You must be signed in to change notification settings - Fork 22
asp .net mvc 获得用户IP
L edited this page Oct 4, 2018
·
2 revisions
string strHostName = System.Net.Dns.GetHostName();
//clientIPAddress是一个数组,可能有多个数据
var clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName);
string clientip = clientIPAddress.GetValue(0).ToString();