在winform里面点击按钮,将winform里的用户名密码通过post的方法传递给要一个网页,并使用浏览器打开此网页,应该怎么实现啊?

解决方案 »

  1.   

    使用webbroswer拼接诶字符串
      webbroswer1.Navigate("http://");
      

  2.   

    post ?
    这个真要依照不同的网站去具体看,
    简单点的就是网址后面拼接查询字符串 http://www.example.com?uid=XXX 之类的
    麻烦点就要自己设置cookies.net里面有个封装好的类,叫HttpRequest(名字大概如此)的类,挺有用的
      

  3.   

    HttpRequest不行啊,不能打开浏览器啊
    webbroswer1.Navigate("http://");
    这个不是显示在webbroswer里了吗,我需要显示在浏览器里
      

  4.   

    http://www.cnblogs.com/coolhao-chen/archive/2009/09/07/1562087.html这个是你想要的
      

  5.   

     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);
            }
    我帮你贴代码才是现实的,懒得让你看
      

  6.   

       请添加  COM 下 的microsoft internet controls 引用.
      

  7.   

     System.Windows.Forms.HtmlDocument HTMLDocument = wbHistorySearch.Document;
                System.Windows.Forms.HtmlElement loginName= HTMLDocument.GetElementById("loginName");
                loginName.InnerText = System.Configuration.ConfigurationSettings.AppSettings["LoginName"].ToString();
                //loginName.Enabled = false;
                System.Windows.Forms.HtmlElement password = HTMLDocument.GetElementById("passwd");
                password.InnerText = System.Configuration.ConfigurationSettings.AppSettings["Password"].ToString();
                //password.Enabled = false;
                System.Windows.Forms.HtmlElement btnLogin = HTMLDocument.GetElementById("login");
                btnLogin.InvokeMember("click");
                btnLogin.Enabled = false;
                System.Windows.Forms.HtmlElement btnReset = HTMLDocument.GetElementById("Submit2");
      

  8.   

    都不起作用的,post过去的数据得看你访问的网页是Session保存的数据还是静态变量。Session你改了也只是在服务器上,客户端请求完成之后客户端是没法加载服务器的Session这应该能理解吧?