如何从C#中的DLL中找到基本URL?

Guy*_*Guy 3 .net c# asp.net url web-applications

从C#.NET Web应用程序调用的DLL中,您如何找到Web应用程序的基本URL?

Ale*_*kov 12

这会有用吗?

HttpContext.Current.Request.Url
Run Code Online (Sandbox Code Playgroud)

更新:

要获取基本URL,您可以使用:

HttpContext.Current.Request.Url.GetComponents(UriComponents.SchemeAndServer, UriFormat.Unescaped)
Run Code Online (Sandbox Code Playgroud)