111,126
社区成员
发帖
与我相关
我的任务
分享 private void btn_Login_Click(object sender, EventArgs e)
{
Process proc = Process.Start("IExplore.exe", "http://mail.126.com");
SetActiveWindow(proc.MainWindowHandle);//激活窗口
SetForegroundWindow(proc.MainWindowHandle);//将窗口放置到前端显示
Thread.Sleep(1000);//等待1000毫秒(1秒),用于等待网页完全打开
SendKeys.SendWait("test");//自动录入邮箱账号
SendKeys.SendWait("{tab}");//自动录入TAB键,用于录入账号后,切换至密码框
SendKeys.SendWait("123123");//自动录入密码
SendKeys.SendWait("{ENTER}");//输入回车键,提交数据登录