Since msdn only provides a partial overview (as seen here) and i was looking for a complete sample i'll share the answer here.
Asked
Active
Viewed 1,199 times
1 Answers
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