SoFunction
Updated on 2025-04-11

Get the root directory URL for example http://localhost:51898


public static string GetRootURI()
{
string AppPath = "";
HttpContext HttpCurrent = ;
HttpRequest Req;
if (HttpCurrent != null)
{
Req = ;

string UrlAuthority = ();
if ( == null || == "/")
// Install directly on the Web site
AppPath = UrlAuthority;
else
//Install in the virtual subdirectory
AppPath = UrlAuthority + ;
}
return AppPath;
}