473,770 Members | 6,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1680
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.co m

"Eþref DURNA" <es*********@my net.com> wrote in message
news:O2******** ******@TK2MSFTN GP10.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.c om> wrote in
message news:e9******** ******@TK2MSFTN GP11.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.co m

"Eþref DURNA" <es*********@my net.com> wrote in message
news:O2******** ******@TK2MSFTN GP10.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.co m

"Eþref DURNA" <es*********@my net.com> wrote in message
news:uf******** ******@TK2MSFTN GP12.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.c om> wrote
in
message news:e9******** ******@TK2MSFTN GP11.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.co m

"Eþref DURNA" <es*********@my net.com> wrote in message
news:O2******** ******@TK2MSFTN GP10.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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5481
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
2724
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was closed. Could not establish a trust relationship with the remote server.
3
4870
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
7
3025
by: Seth | last post by:
I have noticed that the id of my session object changes when I switch from a non-secure to a secure connection. What I'm trying to do: I have a cookie that is built on the non-secure side of things. What I need to do is to switch to a secure connection and then later on while still in that secure connection delete the cookie that was created on the non- secure side. I need to do this because I can not reference the non-secure cookie...
14
3384
by: Schoo | last post by:
I have an asp.net app that uses session objects (ag. session("UserID")). The app works fine in development/debug mode. I released it to the test server (Windows 2000 server with other .NET applications running on it) and when I am sitting at that server running the application, it also runs fine. But, if I sit at any workstation on the LAN it does not work. I narrowed the problem down to the fact that all of the session objects contain...
8
1747
by: ari | last post by:
hey all, i'm trying to make my app as stateless as possible. is it ok to create a dataset and store in viewstate and whenever the user decides to select a from that dataset, to move from viewstate, to session, and on the details page back to viewstate. Or does that sound like too much work? thanks, ari
5
4855
by: Åženol Akbulak | last post by:
Hello; I use in my web application FormsAuthentication. Also I use Session state (InProc). When a user logged in, I can read Session parameters. (For example Session). Problem is that, when user close the browser window then open a new browser, FormsAuthentication reads from cookie and user logs in. Althought user logged in, session parameter is null.
9
2547
by: Adrian Parker | last post by:
We have a website that works everywhere but on a few PCs on this one site.. Asp.Net 1.1 Server = Windows 2003 Client = XP In the web.config we use - cookieless="false" in the browser settings they have "Always allow session cookies" set to true When the browser connects to the website the first page sets a session variable called "user_ref" to something and then calls another page. If on
11
26638
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package and PEAR is in c:\wamp\php\pear I modified php.ini in the c:\wamp\php directory to reflect the actual path, but even stopping and restarting my server shows the c: \php5\pear path. I can't change it no matter what I do I also tried the...
0
10225
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10001
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.