473,466 Members | 1,464 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

URI Format exception. Unable to determine URI Format

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
1 6529
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dinks | last post by:
Hi, I'm new to C++ and have been assigned a task which i dont completely understand. Any help would be greately appreciated. Here is the problem: The class "linkedListType" use the "assert"...
1
by: Muscha | last post by:
Hello, Every now and then my application throw this exception: "Unable to read data from the transport connection" And when I break into the Visual Studio, the thread where it failed has...
0
by: Gaurav | last post by:
Hi, I have a connection string "Data Source=db1.mynet;DATABASE=test;User ID=testuser;Password=test;" , when i use the connection string to get a dataset of all the tables of a database it...
3
by: Jason | last post by:
I'm having a hard time getting a call to HttpWebRequest's GetRequestSteam to work. Each time I try to run it, I get the following error: The underlying connection was closed: Unable to...
1
by: Neo | last post by:
I have a table Contacts with a field "Male" which is of type Bit (SQL Server). I've got two radio buttons in a panel, & one of them is bound to the above field, (so that one can see if the contact...
0
by: Neo | last post by:
I have a table Contacts with a field "Male" which is of type Bit (SQL Server). I've got two radio buttons in a panel, & one of them is bound to the above field, (so that one can see if the...
2
by: js | last post by:
I got this error when I moved my application to a new Windows 2003 server. I installed and recompiled the 'Microsoft.Practices.EnterpriseLibrary - June 2005" then added these assemblies to the...
4
by: Paul | last post by:
The title says it all. Is there a speed efficient way of validating that a string contains valid Xml without the overhead of try catch around a load attempt? Thanks in advance.
17
by: Cramer | last post by:
I plan to implement an exception logging feature in an ASP.NET Web application that writes encountered exceptions to disk. The exception data will be stored as XML. I am planning on having each...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.