猪八戒APP
C#线程中的WebBrowser的问题
徐州
网站定制开发
需求标题
C#线程中的WebBrowser的问题
需求描述
把下面代码执行成功
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;
using WebKit;
using System.Threading;
namespace WindowsFormsApplication1test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Thread t= new Thread(new ThreadStart(auto));
t.Start();
}
private void auto()
{
WebBrowser wb = new WebBrowser();
wb.Navigate("[url=http://invest.ppdai.com/account/lend");]http://invest.ppdai.com/account/lend");[/url]
while (wb.IsBusy)
Application.DoEvents();
HtmlElement UserName = wb.Document.GetElementById("UserName");
HtmlElement PassWord = wb.Document.GetElementById("Password");
HtmlElement LoginButton = wb.Document.GetElementById("login_btn");
UserName.SetAttribute("value", "xxxx");
PassWord.SetAttribute("value", "****");
LoginButton.InvokeMember("Click");
}
}
}
预算金额
¥20元
允许参与人才数量
--
人才所在地
--
人才类型
--
工作反馈要求
无要求
期望完成日期
--
开票类型要求
无要求
类似需求