Problems with URL Syntax

J

Jerry Spence1

I am trying to get a jpg image as follows:

Dim Client As System.Net.WebClient = New System.Net.WebClient
Client.DownloadFile("http://root:<password>@192.168.0.99/cgi-bin/video.jpg",
MyFilename)

However I understand that IE no longer supports this 'in-line' presentation
of the username and password strings. Indeed I am getting a "Not Authorized"
error being returned.

Although I'm not using IE directly, are the components (and the security
contraints) of IE still being used in the background?

Has anyone met this before and is there a work around?

Thanks

-Jerry
 
H

Herfried K. Wagner [MVP]

Jerry Spence1 said:
I am trying to get a jpg image as follows:

Dim Client As System.Net.WebClient = New System.Net.WebClient
Client.DownloadFile("http://root:<password>@192.168.0.99/cgi-bin/video.jpg",
MyFilename)

However I understand that IE no longer supports this 'in-line'
presentation of the username and password strings. Indeed I am getting a
"Not Authorized" error being returned.

It's nowhere specified that username and password can be embedded inside
HTTP URIs (this does not apply to FTP URIs though), and only some browsers
supported this sort of URIs. However, embedding username and password into
URIs is a very bad idea for security reasons. Instead you may want to check
out the 'WebClient' object's 'Credentials' property which can be used to
pass authentication data to the server.
Although I'm not using IE directly, are the components (and the security
contraints) of IE still being used in the background?

No, 'WebClient' has nothing to do with IE. It was simply IE which provided
functionality which was not standard compliant and insecure and has been
abandoned for this reason.
 
J

Jerry Spence1

Herfried K. Wagner said:
It's nowhere specified that username and password can be embedded inside
HTTP URIs (this does not apply to FTP URIs though), and only some browsers
supported this sort of URIs. However, embedding username and password
into URIs is a very bad idea for security reasons. Instead you may want
to check out the 'WebClient' object's 'Credentials' property which can be
used to pass authentication data to the server.


No, 'WebClient' has nothing to do with IE. It was simply IE which
provided functionality which was not standard compliant and insecure and
has been abandoned for this reason.

Credentials worked a treat. Thank you so much!

-Jerry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top