2014-04-04 16 views

Odpowiedz

13

Istnieje few properties, który może podać informacje. Oto przykład.

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

Spróbuj tego.

.html Page

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

w .Vb Page

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

    } 
Powiązane problemy