asp.net获得网址

来源:互联网 发布:steps疏散软件下载 编辑:程序博客网 时间:2024/05/16 02:26

一、整个网址

HttpContext.Current.Request.Url.ToString();

二、域名(不含http://)

Url myurl=HttpContext.Current.Request.Url;

Url myurl=new Url(http://192.168.1.1:8080/index.aspx?id=2);

 

myurl.Host;

三、获得端口

myurl.Port;

 

原创粉丝点击