469,934 Members | 2,704 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

help about downloading with session and cookie support at windows application

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/downloa...241687&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
Nov 17 '05 #1
3 1518
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]
- mv*@spam.guard.caspershouse.com

"E■ref DURNA" <es*********@mynet.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
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/downloa...241687&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

Nov 17 '05 #2
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:e9**************@TK2MSFTNGP11.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"E■ref DURNA" <es*********@mynet.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
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/downloa...241687&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


Nov 17 '05 #3
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]
- mv*@spam.guard.caspershouse.com

"E■ref DURNA" <es*********@mynet.com> wrote in message
news:uf**************@TK2MSFTNGP12.phx.gbl...
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in
message news:e9**************@TK2MSFTNGP11.phx.gbl...
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]
- mv*@spam.guard.caspershouse.com

"E■ref DURNA" <es*********@mynet.com> wrote in message
news:O2**************@TK2MSFTNGP10.phx.gbl...
> 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/downloa...241687&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
>
>



Nov 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Brian Conway | last post: by
3 posts views Thread by Kris van der Mast | last post: by
14 posts views Thread by Schoo | last post: by
8 posts views Thread by ari | last post: by
5 posts views Thread by ┼×enol Akbulak | last post: by
9 posts views Thread by Adrian Parker | last post: by
11 posts views Thread by cybervigilante | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.