2

Since msdn only provides a partial overview (as seen here) and i was looking for a complete sample i'll share the answer here.

Dbl
  • 5,634
  • 3
  • 41
  • 66
  • 1
    ah yes. still using this question as a cheatsheet today - loving how i can instantly find it as my most negative received question -.- – Dbl Feb 21 '18 at 16:13

1 Answers1

5

There result of this code

        var uri = new Uri("https://images.google.de:80/some/subfolder?someQuery=hi&anotherQUery=there", UriKind.Absolute);
        var sb = new StringBuilder();
        foreach (UriComponents value in Enum.GetValues(typeof(UriComponents)))
        {
            sb.AppendLine($"{value} : {uri.GetComponents(value, UriFormat.Unescaped)}");
        }

delivers this result:

Scheme : https
UserInfo : 
Host : images.google.de
Port : 80
SchemeAndServer : https://images.google.de:80
Path : some/subfolder
Query : someQuery=hi&anotherQUery=there
PathAndQuery : /some/subfolder?someQuery=hi&anotherQUery=there
HttpRequestUrl : https://images.google.de:80/some/subfolder?someQuery=hi&anotherQUery=there
Fragment : 
AbsoluteUri : https://images.google.de:80/some/subfolder?someQuery=hi&anotherQUery=there
StrongPort : 80
HostAndPort : images.google.de:80
StrongAuthority : images.google.de:80
NormalizedHost : images.google.de
KeepDelimiter : 
SerializationInfoString : https://images.google.de:80/some/subfolder?someQuery=hi&anotherQUery=there
Dbl
  • 5,634
  • 3
  • 41
  • 66