我正在嘗試使用vb.net獲取客戶端ID。我的代碼下:在vb.net獲取客戶端IP
Partial Class foo
Inherits System.Web.UI.Page
Private ipv4 As New clsIPv4
Dim ref As String = 0
Dim client_ip As String
client_ip = Request.UserHostAddress()
Dim myHost As String = System.Net.Dns.GetHostName()
client_ip = ipv4.ResolveAddress(myHost)
此代碼返回我的IP不會忽略的列表(即182.50.130.143; 118.139.172.1; 118.139.172.2; 118.139.172.3; 118.139.172.4; 118.139.172.5; 118.139。 172.6; 118.139.172.7; 118.139.172.8; 118.139.172.9; 118.139.172.10; 118.139.172.11; 118.139.172.12; 118.139.172.13; 118.139.172.14; 118.139.172.15; 118.139.172.16; 118.139.172.17; 118.139.172.18; 118.139.172.19; 118.139.172.20; 118.139.172.21; 118.139.172.22; 118.139.172.23; 118.139.172.24; 118.139.172.25; 118.139.172.26; 118)。
請指導我在哪裏錯了
我部署我的Windows服務器上的網站。它給了我多個ip.Can你可以請指導我如何得到netid和比較所有ip –
@amrKamboj你想知道什麼ip?你想在你的網站上運行你的客戶端IP地址或主機的IP地址嗎? – Karamafrooz
我想獲取客戶端IP而不是主機IP。 –