Click here to Skip to main content
15,879,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can i get cookie from webBrowser1 control of c#.

C#
string username = "myusername";
        string password = "pwd";
        string loginOp="log";
            string client="pref";


 // format our data that we are going to post to the server

 // this will include our post parameters.  

 string postData = string.Format("loginOp={0}&username={1}&password={2}&client={3}",loginOp,username,password,client);

 ASCIIEncoding enc = new ASCIIEncoding();



 //  we are encoding the postData to a byte array

 webBrowser1.Navigate("https://MainWebsite/y/search?mesg=hell0&initial=false&app=", "", enc.GetBytes(postData), "Content-Type: application/x-www-form-urlencoded");


post parameters can be send like above code , how can i send cookie with this request.
Posted
Updated 16-Jul-13 19:19pm
v3
Comments
Menon Santosh 16-Jul-13 6:08am    
tell me the name of site
ZurdoDev 16-Jul-13 8:01am    
Perhaps you are not posting properly.
footballpardeep 16-Jul-13 23:09pm    
@Menon Santosh, sorry i can't tell you name of the website.

@ryab31, yes, may be.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900