ASP.NET 关于 服务器 URL

来源:百度知道 编辑:UC知道 时间:2024/06/18 15:18:00
asp.net中 http://localhost:1407/WebSite1/page/EnjoyPage.aspx 页面的
http://localhost:1407 如何获得.服务器更换地址也能使用.

http://localhost:1407

把localhost换成IP或域名
1407为端口号

给你一个例子:
测试的url地址是http://www.test.com/testweb/default.aspx, 结果如下:

Request.ApplicationPath: /testweb
Request.CurrentExecutionFilePath: /testweb/default.aspx
Request.FilePath: /testweb/default.aspx
Request.Path: /testweb/default.aspx
Request.PathInfo:
Request.PhysicalApplicationPath: E:\WWW\testweb\
Request.PhysicalPath: E:\WWW\testweb\default.aspx
Request.RawUrl: /testweb/default.aspx
Request.Url.AbsolutePath: /testweb/default.aspx
Request.Url.AbsoluteUri: http://www.test.com/testweb/default.