ASP. NET Get URL method

Source: Internet
Author: User
Tags server port

Here's how:

Request.Url.ToString () Get the full Url (protocol name + domain + site name + file name + parameter): https://localhost:44300/webform1.aspx?abc=123Request.rawurl get URL information for client requests (not including host and port):/webform1.aspx?abc=123Request.Url.AbsolutePath Get Site name+ page Name:/WebForm1.aspxRequest.Url.Host Get host part: LocalhostRequest.Url.Query Gets the parameters section:? abc=123Request.applicationpath Get the application's virtual application root path:/Request.currentexecutionfilepath Gets the virtual path of the current request:/WebForm1.aspxRequest.Path Gets the virtual path of the current request:/WebForm1.aspxRequest.PathInfo Get additional path information for a resource with a URL extension: Request.PhysicalPath Gets the physical file system path that corresponds to the requested URL: c:\users\jim\ Documents\Visual Studio .\projects\webapplication3\webapplication3\webform1.aspxrequest.url.localpath Gets the local operating system representation of the file name:/WebForm1.aspxRequest.Url.AbsoluteUri Get absolute Url:https://localhost:44300/webform1.aspx?abc=123Request.ServerVariables.Get ("local_addr") Get server IP::1Request.Url.Port Get the server port:44300Request.Url.Scheme Get Server protocol header: HTTPS

ASP. NET Get URL method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.