By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,089 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,089 IT Pros & Developers. It's quick & easy.

URI Format exception. Unable to determine URI Format

P: n/a
Bob
Hi Trying out NetworkCredential class.
The code from the help example fails when you try to do an add to the
Credential cache.
'Invalid URI. The format of the URI can not be determined.'
I don't expect my quoted name, password and domain to pass but I would have
thought that the credential should have added to the cache OK
Thanks.
Bob
NetworkCredential myCred = new NetworkCredential(

"SecurelyStoredUserName", "SecurelyStoredPassword", "SecurelyStoredDomain");

CredentialCache myCache = new CredentialCache();

myCache.Add(new Uri("www.contoso.com"), "Basic", myCred); //FAILS HERE

myCache.Add(new Uri("app.contoso.com"), "Basic", myCred);

WebRequest wr = WebRequest.Create("www.contoso.com");

wr.Credentials = myCache;
Mar 13 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Bob
Forget it.
Found another example that works.
Thanks
Bob
"Bob" <bo*@nowhere.com> wrote in message
news:OK**************@TK2MSFTNGP09.phx.gbl...
Hi Trying out NetworkCredential class.
The code from the help example fails when you try to do an add to the
Credential cache.
'Invalid URI. The format of the URI can not be determined.'
I don't expect my quoted name, password and domain to pass but I would have thought that the credential should have added to the cache OK
Thanks.
Bob
NetworkCredential myCred = new NetworkCredential(

"SecurelyStoredUserName", "SecurelyStoredPassword", "SecurelyStoredDomain");
CredentialCache myCache = new CredentialCache();

myCache.Add(new Uri("www.contoso.com"), "Basic", myCred); //FAILS HERE

myCache.Add(new Uri("app.contoso.com"), "Basic", myCred);

WebRequest wr = WebRequest.Create("www.contoso.com");

wr.Credentials = myCache;

Mar 13 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.