判断textbox1.text为不为空,如果不为空,给值给textbox2,如果为空,给值给textbox1

解决方案 »

  1.   

    view plaincopy to clipboardprint:private void button1_Click( object sender, EventArgs e )   
    {   
        System.Windows.Forms.HtmlDocument document =this.webBrowser1.Document;   
        if ( document == null )   
        {   
            return;   
        }   
        document.All["logname"].SetAttribute( "Value", "用户名" );            //用户名   
        document.All["originalLogpasswd"].SetAttribute( "Value", "密码" );      //密码   
        document.All["dologin"].InvokeMember( "click" );    //登录按钮的click方法         
    }  
            private void button1_Click( object sender, EventArgs e )
            {
                System.Windows.Forms.HtmlDocument document =this.webBrowser1.Document;
                if ( document == null )
                {
                    return;
                }
                document.All["logname"].SetAttribute( "Value", "用户名" );            //用户名
                document.All["originalLogpasswd"].SetAttribute( "Value", "密码" );      //密码
                document.All["dologin"].InvokeMember( "click" );    、、按钮的click
            }