473,385 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Question about using : in URL

Hello Everyone,

I'm using an URI object and I need to pass the url as follows:

http://ausername:ap*******@example.com

The problem is that when VB.NET encounters the colon in the URL it
thinks it's a port and can't parse it. Is there a better way to pass
these credentials or, if not, how can I get around this?

Thanks!
Nov 21 '08 #1
2 1145
On Nov 21, 4:54*am, "Anthony P." <papill...@gmail.comwrote:
Hello Everyone,

I'm using an URI object and I need to pass the url as follows:

http://ausername:apassw...@example.com

The problem is that when VB.NET encounters the colon in the URL it
thinks it's a port and can't parse it. Is there a better way to pass
these credentials or, if not, how can I get around this?

Thanks!
Hi,
You can try to initialize a NetworkCredential object and pass
username, password and domain in its constructor as
follows:

Imports System.Net
Dim nc As New NetworkCredential("user","pass","domain")

http://msdn.microsoft.com/en-us/libr...redential.aspx
http://msdn.microsoft.com/en-us/libr...roperties.aspx

Hope this helps,

Onur Güzel
Nov 21 '08 #2
"Anthony P." <pa*******@gmail.comschrieb:
I'm using an URI object and I need to pass the url as follows:

http://ausername:ap*******@example.com

The problem is that when VB.NET encounters the colon in the URL it
thinks it's a port and can't parse it. Is there a better way to pass
these credentials or, if not, how can I get around this?
As mentioned in the other post, use 'NetworkCredentials' instead. Note that
the above URI is actually /not/ a valid HTTP URI because HTTP URIs must not
contain credentials like FTP URIs, for example. Only some browsers support
credentials as part of HTTP URIs (this dangerous "feature" has been dropped
from IE some years ago).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mohammed Mazid | last post by:
Can anyone please help me on how to move to the next and previous question? Here is a snippet of my code: Private Sub cmdNext_Click() End Sub Private Sub cmdPrevious_Click() showrecord
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Simon Harvey | last post by:
Hi everyone, I was wondering if it is possible, to use SQL to return more than one table at a time into a dataset. I only know the basics of SQL and so I'm not sure if I'm just asking a stupid...
44
by: lester | last post by:
a pre-beginner's question: what is the pros and cons of .net, compared to ++ I am wondering what can I get if I continue to learn C# after I have learned C --> C++ --> C# ?? I think there...
5
by: sea | last post by:
I have 2 applications, one a Microsoft Visual Basic application and the other a Java application both connecting to the same DB2 database. The database has binary LOB objects. The Visual Basic...
11
by: Mark Yudkin | last post by:
The documentation is unclear (at least to me) on the permissibility of accessing DB2 (8.1.5) concurrently on and from Windows 2000 / XP / 2003, with separate transactions scope, from separate...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
13
by: Elaine | last post by:
This has to do with self-joins and includes a running balance problem. Is it possible to do this using SQL alone? Amortization schedule -------------------------- Givens: beginning balance,...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.