Winform uses Post to open IE
1. Mainly implement Code 1 void OpenNewIe (string url, string postData) // url is the url to post, and postData is the parameter to be passed in 2 {3 if (ie! = Null) // avoid opening the ie Object repeatedly without releasing it, and throw an exception 4 {5 try 6 {7 ie. quit (); 8} 9 catch10 {11 ie = null; 12} 13} 14 ie = new InternetExplorer (); 15 object vPost, vHeaders, vFlags, vTargetFrame; 16 vPost = Encoding. getEncoding ("GB2312 "). getBytes (postData); // Note whether the encoding method is GB2312 or ASCII17 vFlags = null; 18 vTargetFrame = null; 19 vHeaders = "Content-Type: application/x-www-form-urlencoded "+ Convert. toChar (10) + Convert. toChar (13); 20 ie. visible = true; 21 ie. navigate (url, ref vFlags, ref vTargetFrame, ref vPost, ref vHeaders); 23} 2. parameter passing 1 StringBuilder postData = new StringBuilder (); 2 postData. appendFormat ("uid = {0}", HelpEncrypt. encode (uid. toString (), key); 3 postData. appendFormat ("& serial_number = {0}", HelpEncrypt. encode (serial_number, key); 3. call method 1 if (checkBoxNo. checked) 2 {3 OpenNewIe (Parameter. payaddress, postData. toString (); 4} 4. additional: Use the WebBrowser component Post to open IE 1 private void TransferWebForm_Load (object sender, EventArgs e) 2 {3 string vHeaders = "Content-Type: application/x-www-form-urlencoded "+ Convert. toChar (10) + Convert. toChar (13); 4 byte [] vPost = Encoding. getEncoding ("GB2312 "). getBytes (_ postData); 5 this. webBrowser1.Navigate (navigateUrl, null, vPost, vHeaders); 6}