Request.Url | http://localhost:1682/DotnetTests/GetURL.aspx |
Request.ServerVariables["SCRIPT_NAME"] | /DotnetTests/GetURL.aspx |
Request.AppRelativeCurrentExecutionFilePath | ~/GetURL.aspx |
System.IO.Path.GetFileName(Request.AppRelativeCurrentExecutionFilePath) | GetURL.aspx |
System.IO.Path.GetFileName(Request.ServerVariables["SCRIPT_NAME"]) | GetURL.aspx |
System.IO.Path.GetFileName(Request.Url.ToString()) | GetURL.aspx |
Getting various bits of URL with C#
Need some bit or all of the URL for any reason?