All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
在ASP.NET里得到网站的域名_[Asp.Net教程]

Writer: delv Article type: Programming skills(编程技巧) Time: 2014/1/6 9:11:32 Browse times: 277 Comment times: 0

在ASP.NET里得到网站的域名_[Asp.Net教程]


Head photo

Go homepage
Upload pictures
Write articles

在ASP.NET里得到网站的域名_[Asp.Net教程]

Dim url, host_url, no_http, host_name As String '定义变量
url = HttpContext.Current.Request.Url.ToString '获取当前页的URL
no_http = url.Substring(url.IndexOf("//") + 2) '截取去掉HTTP://的URL
host_url = "http://" & no_http.Substring(0, no_http.IndexOf("/") + 1) '组合成当前网站的域名

来源:网络





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.