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

Downloading

P: n/a
I am trying to make a downloader using sockets to download pictures from a
website
I have to log in to the website, so I am adding a line for authentication
"Authentication Basic base64(user:pass). But I get back a page that says
user must login. The address is a secure server (https://domain.com). Do I
need to do something different?
May 23 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you are using the Socket class to connect to the server and manually
writing and parsing HTTP headers, you will need to use
System.Security.SslStream to handle SSL handshaking with the secure server.
First, create a NetworkStream encapsulating your Socket, and create a new
SslStream which encapsulates the NetworkStream. Then call
SslStream.AuthenticateAsClient to perform handshaking. Once complete, you
can use the SslStream as needed to read and write data securely to the
endpoint.

Another option would be to use System.Net.WebClient to grab data from a web
server. WebClient will automatically write and parse HTTP headers (of
course) and automatically utilize SSL if necessary.

Hope this helps,
Andrew

"Lespaul36" <le*******@none.netwrote in message
news:eq**************@TK2MSFTNGP04.phx.gbl...
>I am trying to make a downloader using sockets to download pictures from a
website
I have to log in to the website, so I am adding a line for authentication
"Authentication Basic base64(user:pass). But I get back a page that says
user must login. The address is a secure server (https://domain.com). Do
I need to do something different?

May 29 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.