What’s in System.Uri

I can never seem to remember just what each property on System.Uri means so I have this little powershell one liner that will do the trick:

$uri = new-object -TypeName System.Uri http://localhost:880/vdir/file.xml?q=1

$uri | format-list

Here’s the results, makes a nice cheat sheet

 

AbsolutePath   : /vdir/file.xml
AbsoluteUri    : http://localhost:880/vdir/file.xml?q=1
Authority      : localhost:880
Host           : localhost
HostNameType   : Dns
IsDefaultPort  : False
IsFile         : False
IsLoopback     : True
IsUnc          : False
LocalPath      : /vdir/file.xml
PathAndQuery   : /vdir/file.xml?q=1
Port           : 880
Query          : ?q=1
Fragment       :
Scheme         : http
OriginalString : http://localhost:880/vdir/file.xml?q=1
DnsSafeHost    : localhost
IsAbsoluteUri  : True
Segments       : {/, vdir/, file.xml}
UserEscaped    : False
UserInfo       :

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s