Home → Resources → Articles

System.Uri Properties Reflection

(Microsoft .NET,Microsoft ASP.NET) by Jason Skowronek on 10/07/2011

I felt it would be useful (at least for me) to keep a property map available of the System.Uri class and it's respective values as they relate to a standard URI/URL.

This should prove useful when forgetting (which I often do) all the fields and their meanings.

The following table reflects a standard formatted URL:

https://www.example.com/some/path/page.ext:8080?query=value#hashfragment

Here is the reflected output.

Property Value
AbsolutePath /some/path/page.html
AbsoluteUri http://www.example.com:8080/some/path/page.html?query=value#hashfragment
Authority www.example.com:8080
Host www.example.com
HostNameType Dns
IsDefaultPort False
IsFile False
IsLoopback False
IsUnc False
LocalPath /some/path/page.html
PathAndQuery /some/path/page.html?query=value
Port 8080
Query ?query=value
Fragment #hashfragment
Scheme http
OriginalString http://www.example.com:8080/some/path/page.html?query=value#hashfragment
DnsSafeHost www.example.com
IsAbsoluteUri True
Segments /
some/
path/
page.html
UserEscaped False
UserInfo  
 

Recommend

CS5 Web Premium - Download 

System Mechanic 

 

SkoNet provides comprehensive digital consulting services such as: web development, applications development, database design and architecture, business process management, customer relationship management, and many others that help businesses of every size, industry, and geography meet the complex challenge of managing and sharing information on the web. Our skills and expertise in online systems allow us to help customers build applications ranging from simple, single-page web sites to robust enterprise systems.

Online Backup, Ektron Consulting, Ektron Programmer, Ektron Developer, Ektron Partner Utah, Ektron Partner, Ektron Architect, Ektron Hosting, Salesforce.com Consultant Utah, Salesforce.com Partner Utah, Salesforce.com Partner, Salesforce.com Programmer, Salesforce.com Architect, Salesforce.com APEX Programmer