简体   繁体   中英

How to add cookie in my web browser control?

I want to add cookie in my web browser control.

webBrowser1.Navigate(new Uri(serverUrl)); 

Basically i need to put cookie value at the time of the navigation.How can i add cookie to this type request in windows phone 7

Let me explain my complete problem.

I have to send an Authentication key through cookies to the webrequest for the server to authenticate the client. In mobile devices like Android and iPhone, they have a Cookie container where the browser control takes the data from the cookie container. I expected WP7 to have similar facility, but I didnot find it. (Did I miss it ? if so please direct me.)

Please help me...Thanks

I am not sure this will work or not. But you can call JavaScript functions inside a page from C# using Web Browser control and in JavaScript you can set the cookie. To call JavaScript functions of Web Browser controls see the link below.

 webBrowser1.Document.InvokeScript(jsfunctionname, parameters);

http://notions.okuda.ca/2009/06/11/calling-javascript-in-a-webbrowser-control-from-c/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM