C# 如何控制 打开的ie网页 插入填写信息
解决重酬!!
例如
https://ask.csdn.net/questions/749719 采纳后帮你写一个。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Threading;
using SHDocVw;
namespace Q749719
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
SHDocVw.InternetExplorer ie;
private void button1_Click(object sender, EventArgs e)
{
ie = new SHDocVw.InternetExplorer();
ie.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler(ie_DocumentComplete);
complete = false;
ie.Navigate("http://www.baidu.com");
ie.Visible = true;
while (!complete)
{
Application.DoEvents();
Thread.Sleep(1000);
}
}
bool complete = false;
private void button2_Click(object sender, EventArgs e)
{
var doc = ie.Document;
doc.getElementById("kw").innerText = textBox1.Text;
}
void ie_DocumentComplete(object pDisp, ref object URL)
{
complete = true;
}
private void button3_Click(object sender, EventArgs e)
{
var doc = ie.Document;
doc.getElementById("su").click();
}
}
}