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;
namespace AccessWeb
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
HtmlElement tbUserid = webBrowser1.Document.All["email"];
HtmlElement tbPasswd = webBrowser1.Document.All["password"];
HtmlElement btnSubmit = webBrowser1.Document.All["action"];
if (tbUserid == null || tbPasswd == null || btnSubmit == null)
return;
tbUserid.SetAttribute("value", "test1@qq.com");
tbPasswd.SetAttribute("value", "testtest");
btnSubmit.InvokeMember("value", "login");
}
}
}
C#访问网站
最新推荐文章于 2023-10-30 23:08:55 发布