help about downloading with session and cookie support at windows application

  • Thread starter Thread starter Eþref DURNA
  • Start date Start date
E

Eþref DURNA

My Aim is to make a windows application download which support session and
cookies.

There is a web site which gives images as links like this
http://www.comstock1700k.com/downlo...eceff24e9ad547e1dfa96098&t=1132241687&u=esref
When ever I click to save as a target as or download using flash get that
programs could download the file correctly
but when ever I use
WebClient or httprequest it sends me to the login page..
Does somebody have any idea?
or an example ?

Esref DURNA
 
Esref,

Well, you can't just go to that site. When you go with your browser,
you have a cookie that might identify you, or you go to a login page which
gives you a temporary cookie.

Regardless, you have to mimic the request that your browser would make,
would would more than likely mean you would have to send the cookies in the
request.

I would use a sniffer (try TcpTrace) to see what is being sent, and then
mimic that request with the HttpRequest class.

Hope this helps.
 
No when Ever you copy the url from that web site and
open a new internet explorer and paste it that link works.
So I do not need the login cookie.
I only want to have a downloader which could get the cookies and sessions
which the server sends.
Thanks for your help

Esref DURNA

Nicholas Paldino said:
Esref,

Well, you can't just go to that site. When you go with your browser,
you have a cookie that might identify you, or you go to a login page which
gives you a temporary cookie.

Regardless, you have to mimic the request that your browser would make,
would would more than likely mean you would have to send the cookies in the
request.

I would use a sniffer (try TcpTrace) to see what is being sent, and then
mimic that request with the HttpRequest class.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Eþref DURNA said:
My Aim is to make a windows application download which support session and
cookies.

There is a web site which gives images as links like this
http://www.comstock1700k.com/downlo...eceff24e9ad547e1dfa96098&t=1132241687&u=esref
When ever I click to save as a target as or download using flash get that
programs could download the file correctly
but when ever I use
WebClient or httprequest it sends me to the login page..
Does somebody have any idea?
or an example ?

Esref DURNA
 
Esref,

If it just works in your browser, then you are sending something that is
indicating that it should work (for example, if I try and go to that site,
it does not work). So you are sending something in your request that the
browser knows about, but your HttpWebRequest does not.

When you use WebClient or HttpWebRequest, they don't know about the
cookies that are stored locally on your machine. If you are accessing a
site, you need to fetch those and place them in your request.

If you "sniff" a request from your browser to the site for that URL, you
will see what I mean in the headers.

There is another tool, Fiddler (from MS) which is specifically for
sniffing HTTP requests. I would recommend using that to sniff your requests
from your browser.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Eþref DURNA said:
No when Ever you copy the url from that web site and
open a new internet explorer and paste it that link works.
So I do not need the login cookie.
I only want to have a downloader which could get the cookies and sessions
which the server sends.
Thanks for your help

Esref DURNA

in
message news:[email protected]...
Esref,

Well, you can't just go to that site. When you go with your browser,
you have a cookie that might identify you, or you go to a login page
which
gives you a temporary cookie.

Regardless, you have to mimic the request that your browser would make,
would would more than likely mean you would have to send the cookies in the
request.

I would use a sniffer (try TcpTrace) to see what is being sent, and then
mimic that request with the HttpRequest class.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Eþref DURNA said:
My Aim is to make a windows application download which support session and
cookies.

There is a web site which gives images as links like this
http://www.comstock1700k.com/downlo...eceff24e9ad547e1dfa96098&t=1132241687&u=esref
When ever I click to save as a target as or download using flash get that
programs could download the file correctly
but when ever I use
WebClient or httprequest it sends me to the login page..
Does somebody have any idea?
or an example ?

Esref DURNA
 
Back
Top