public partial class Form2 : Form
{
/// <summary>
/// 随机调取上传控件
/// </summary>
Random R = new Random();
public Form2()
{
InitializeComponent();
}
private void Form1_Load(object sender, System.EventArgs e)
{
this.webBrowser1.Navigate("http://localhost/chacha/WebForm1.aspx");
}
private void axWebBrowser1_DocumentComplete(object sender, WebBrowserDocumentCompletedEventArgs e)
{
// button2_Click(null, null);
MessageBox.Show("dsdd");
读取上传控件();
}
/// <summary>
/// 读取上传控件
/// </summary>
/// <returns></returns>
List<HtmlElement> 读取上传控件()
{
List<HtmlElement> l = new List<HtmlElement>();
foreach (HtmlElement f in webBrowser1.Document.GetElementsByTagName("input"))
{
i
在WebBrowser中通过模拟键盘鼠标操控网页中的文件上传控件(核心代码)
最新推荐文章于 2023-05-26 11:15:43 发布