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
>
>