Skip to content

Instantly share code, notes, and snippets.

@TwitchBronBron
Created October 3, 2019 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TwitchBronBron/2482b7ff3b047a241ac2c2cf68ef4289 to your computer and use it in GitHub Desktop.
Save TwitchBronBron/2482b7ff3b047a241ac2c2cf68ef4289 to your computer and use it in GitHub Desktop.
dotnet framework base url
public class AppConfig
{
public string GetBaseUrl()
{
var req = HttpContext.Current.Request;
return $"{req.Url.Scheme}://{req.Url.Authority}{req.ApplicationPath.TrimEnd('/')}/";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment