日期:2014-05-17 浏览次数:21140 次
private void button1_Click(object sender, EventArgs e)
{
Thread threadstart = new Thread(new ThreadStart(Mystart));
threadstart.IsBackground = true;
threadstart.Start();
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
if (richTextBox1.Text.Length == 4)
{
detailCollectedEvent.Set();
}
}
AutoResetEvent detailCollectedEvent = new AutoResetEvent(false);
private void Mystart()
{
Con();
detailCollectedEvent.WaitOne();
SendPost(richTextBox1.Text);
}
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.Threading;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Thread threadstart = new Thread(new ThreadStart(Mystart));
threadstart.IsBackground = true;
threadstart.Start();
&n