473,383 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Reading Cookies from windows application

Hi All,
I am developing a download manager for a a website downloads.The problem is , I have to login in my windows application with same user credentials of web login when I logging in web application.In web application , I set cookies with user credentials ; but, Not able to read them in windows.I have tried the ideas suggested by http://p2p.wrox.com/topic.asp?TOPIC_ID=29325 .
I am not able to read the cookies created in Firefox while scanning cookie folder.When I am trying to read through HttpRequest , It only returns the ASP_net cookie.
How do I capture the credential of web login from my desktop application.Please Help Me.

Regards,
Preethi
May 13 '08 #1
6 2956
Plater
7,872 Expert 4TB
Couldn't you just set your own?
When I use HttpWebRequest, I can see the cookies that are trying to be created and keep track of them.


Or are you trying to use "already logged in" user information, aka snooping through the cookies stored by the browser already?
May 13 '08 #2
Hi,
I am trying to use HttpWebReques.while using the code,
Expand|Select|Wrap|Line Numbers
  1.  HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  2.  request.CookieContainer = new CookieContainer();
  3.  HttpWebResponse response = (HttpWebResponse) request.GetResponse();
  4.  response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
  5.  
  6.  
It seems that It creates a new request to URL and hence no one is logged in through this code; so, no cookie for user credentials is created and am not getting such a cookie.From Here , How do I proceed ?.please help me.

Thanks with anticipation,
Preethi.
May 13 '08 #3
Plater
7,872 Expert 4TB
You can use the HttpWebReuest to log in. Get the user credentials from the user (texboxes?) Then go through the login motions and receive the cookie from the response object. Then just make sure to keep that cookie in all your requests?
May 13 '08 #4
Hi Plater,
Thank you for your quick replies.I Got your point of "Using user credentials for all logins".but, the problem is,I want to auto login in my windows application when web page gives some download links.at that time ,my windows application (Download Manager) has to log in and display previous downloads of the user . I have created a window service which is identifying a download link clicked and invoke the windows application.I works the fine if user credential are not needed (without any auto login).Now, I want auto login with user credentials. Is there any other way that a web page to leave some user credential in a client system (such as file,XML ) and captured by a windows application?.

Thanks,
Preethi
May 14 '08 #5
NitinSawant
270 100+
You can use the HttpWebReuest to log in. Get the user credentials from the user (texboxes?) Then go through the login motions and receive the cookie from the response object. Then just make sure to keep that cookie in all your requests?
Yo, plater bro,
Can you post some example for loging into website using above method??
May 14 '08 #6
Plater
7,872 Expert 4TB
Ah ok, you have your program working in tandum with the browser.
So when a user is at a site and clicks a link to download, your pogram popups up and goes through the motions of downloading it?

Did you install your services to act as a web proxy? If so, user credentials will be sent to the proxy device and can be read from the user request that gets sent to it.

As for retreiving user credentials in your situation, without getting to see the full original request, I'm stumped at the moment.
May 14 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Ernest Griffin | last post by:
I am developing a windows application to run the IE object(AxSHDocVw.AxWebBrowser) in kiosk mode. I am interested in how to clear the cookies associated to the session that I am working in that...
0
by: Amratash | last post by:
Hi, I needyour help.Its urgent. My main aim is to log the site activities in a database at runtime. I'm using W3C Extended Log File format for logging information. I can use ODBC Logging directly...
6
by: DJones | last post by:
I'm using the following code in my .Net application (.Net v1.1, Windows 2000) to write Session Cookies. HttpContext.Current.Response.Cookies("cookieSession")("SessionID") = strSessionID ...
16
by: Cheung, Jeffrey Jing-Yen | last post by:
I have a windows form application that generates a request, downloads an image, and waits the user to enter in login info. Unfortunately, this image is dynamic and based on session data. I have...
0
by: Susan Van Houen | last post by:
Hi Everybody, I have a problem that is driving me crazy and I am hoping for some help here. I am building an application (vb.net, vs2003) that crawls selected websites. The application works...
4
by: Gridlock | last post by:
I'm trying to read the cookies using HttpContext.Current.Request.Cookies, but the only cookie that I get is the ASP.NET SessionId cookie. There are many cookies on the machine, why am I only...
3
by: ramesh.nrk | last post by:
Hi, Is there any way to read the cookies which are in local machine? Can we create cookies using windows Application in the local machine? I am developing a windows application which needs...
29
by: Guillaume Dargaud | last post by:
Hello all, anybody knows if there's some ANSI-C conformant code around that can read Windows-style .ini files ? I don't care about writing to it but I need to be able to read it from various OSs,...
7
by: cmrchs | last post by:
Hi, In Windows Vista: where does asp.net write its cookies? I use HttpCookie objCookie = new HttpCookie("nameCookie"); in Win2000 (and later) they used to be in C:\Documents and...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.