Shashank,
What you have to do is read the cookie collection from where the browser
keeps the cookies. For IE, you can call the WinInet library functions
through the P/Invoke layer. For other browsers, you will have to make a
call dependent on the browser architecture.
Once you have that, you can use the CookieContainer request on the
HttpWebRequest class to associate cookies with the request you are making.
You will probably want to make sure you set the UserAgent property as
well, just so the service thinks you are coming through a browser (it might
make some decisions on what to send back based on that, but without knowing
what the service does or who controls it, it is impossible to say).
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Shashank" <sh***************@gmail.comwrote in message
news:11**********************@y5g2000hsa.googlegro ups.com...
Hi all,
I am making a http request to a html page residing on a server through
a desktop application .
The page is actually an html page with some perl queries on the top.
For this page I have some cookies set on my local browser.
The content of the page is dependent on the cookie value
My problem is that when I make the request through a browser, I am
getting the right contents, but when I make request through my desktop
application the contents are same as required.
Is there any way to make the http request via the browser or anyway to
retrieve the cookies.
Please help me out.
Thanks in advance