|
Dim url, host_url, no_http, host_name As String '定義變量
url = HttpContext.Current.Request.Url.ToString '獲取當前頁的URL
no_http = url.Substring(url.IndexOf("http://") + 2) '截取去掉HTTP://的URL
host_url = "http://" & no_http.Substring(0, no_http.IndexOf("/") + 1) '組合成當前網站的域名
AspNet技術:在ASP.NET里得到網站的域名,轉載需保留來源!
鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。