public static void OpenNewIe(string url, string postData) { var ie = new InternetExplorer(); object vPost, vHeaders, vFlags, vTargetFrame; vPost = null; vFlags = null; vTargetFrame = null; vHeaders = "Content-Type: application/x-www-form-urlencoded" + Convert.ToChar(10) + Convert.ToChar(13); if (!string.IsNullOrEmpty(postData)) vPost = ASCIIEncoding.ASCII.GetBytes(postData); ie.Visible = true; ie.Navigate(url, ref vFlags, ref vTargetFrame, ref vPost, ref vHeaders); }
使用InternetExplorer要添加引用,在COM下的Microsoft Internet Controls,添加以后就可以了