<分区>
谁能帮我在 C# 中获取 ASP.NET 当前工作页面的 URL?
<分区>
谁能帮我在 C# 中获取 ASP.NET 当前工作页面的 URL?
最佳答案
试试这个:
string url = HttpContext.Current.Request.Url.AbsoluteUri;
// http://localhost:1302/TESTERS/Default6.aspx
string path = HttpContext.Current.Request.Url.AbsolutePath;
// /TESTERS/Default6.aspx
string host = HttpContext.Current.Request.Url.Host;
// localhost
关于c# - C#中如何获取当前页面的URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/593709/