js模拟表单提交

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace LK.BPMS.CSLogin
{
    public partial class ClientWb : Form
    {
        public string token { get; set; }
        public ClientWb(string token)
        {
            InitializeComponent();
            this.token = token;
        }

        string path = System.Configuration.ConfigurationSettings.AppSettings["Uri"];
        
        private void ClientWb_Load(object sender, EventArgs e)
        {
            string js = "<script type="text/javascript">window.onload=function(){document.getElementById("tokenid").click();}</script>";

            webBrowser1.DocumentText = "<form action="" + path + "" method="post"><input type="submit" id="tokenid" name="token" value="" + token + "" onsubmit="return checkForm()"/></form>" + js + "";
            
            //webBrowser1.Navigate(ut);
        }
    }
}
原文地址:https://www.cnblogs.com/xiaz/p/5266162.html