日期:2014-05-17 浏览次数:21012 次
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace ReadCSV
{
public partial class Form1 : Form
{
Thread loginThread1 = null;
Thread loginThread2 = null;
Mutex mutex = null;
public delegate void webBrowserDocReq();
private webBrowserDocReq wbdr;
public Form1()
{
InitializeComponent();
this.wbdr = new webBrowserDocReq(loginMethod);
}
private void buttonLogin_Click(object sender, EventArgs e)
{
loginThread1 = new Thread(btnNavi);
loginThread2 = new Thread(btnLogin);
mutex = new Mutex();
loginThread1.Start();
loginThread2.Start();
}
private void btnNavi()
{
lock (this)
{
mutex.WaitOne();
webBrowser1.Navigate(new Uri(textUrl.Text.ToString()));
Thread.Sleep(2000);
mutex.ReleaseMutex();
}
}
private void btnLogin()
{
lock (this)
{