2014-04-04 8 views

risposta

13

C'è uno few properties che può darti le informazioni. Ecco un esempio.

Dim url As String = HttpContext.Current.Request.Url.AbsoluteUri 
Dim path As String = HttpContext.Current.Request.Url.AbsolutePath 
Dim host As String = HttpContext.Current.Request.Url.Host 
0

VB.NET

Imports System.Net.Dns 
Imports System.Net 

Dim host As String = HttpContext.Current.Request.Url.Host 
Dim hostname As IPHostEntry = Dns.GetHostEntry(host) 
Dim ip As IPAddress() = hostname.AddressList 
Label1.Text = ip(1).ToString() 
0

Prova questo.

.html Pagina

<div> 
    <h1> Url: </h1> <asp:Label ID="Label1" runat="server" Text=""></asp:Label> 
    </div> 

in .vb Pagina

protected void Page_Load(object sender, EventArgs e) 
    { 
     Label1.Text = Request.Url.ToString(); 

    }