H
Hans
Hello,
I am trying to create a Webrequest. The used Uri is something like
"http://[email protected]:[email protected]".
Note that the username contains an "@"-character.
I tried two ways. Neither does work.
1. Directly creating an Uri:
Uri u=new Uri("http://[email protected]:[email protected]");
It fails with an System.UriFormatException (Something like "The hostname
cannot be parsed.")
2. Using an UriBuilder:
UriBuilder ub=new UriBuilder();
ub.Host="www.shfgshfge.com";
ub.Scheme="http";
ub.Path="/";
ub.Username="(e-mail address removed)";
ub.Password="password";
Uri u=ub.Uri;
It fails with the above error.
Unfortunately, the UserInfo property of Uri is readonly.
How can I generate a valid Uri from this string and subsequently use it in a
WebRequest?
TIA
I am trying to create a Webrequest. The used Uri is something like
"http://[email protected]:[email protected]".
Note that the username contains an "@"-character.
I tried two ways. Neither does work.
1. Directly creating an Uri:
Uri u=new Uri("http://[email protected]:[email protected]");
It fails with an System.UriFormatException (Something like "The hostname
cannot be parsed.")
2. Using an UriBuilder:
UriBuilder ub=new UriBuilder();
ub.Host="www.shfgshfge.com";
ub.Scheme="http";
ub.Path="/";
ub.Username="(e-mail address removed)";
ub.Password="password";
Uri u=ub.Uri;
It fails with the above error.
Unfortunately, the UserInfo property of Uri is readonly.
How can I generate a valid Uri from this string and subsequently use it in a
WebRequest?
TIA