日期:2014-05-17 浏览次数:20736 次
public class ThreadClas
{
public void Start()
{
AutoResetEvent Are;
Are = new AutoResetEvent(false);
ThreadPool.QueueUserWorkItem(ThreadMethod, Are);
}
public delegate void ThreadEvent();
public event ThreadEvent OnThreadExecute;
private void ThreadMethod(object State)
{
AutoResetEvent Are = (AutoResetEvent)State;
OnThreadExecute();//此处执行用户自定义事件
Are.Set();
}
}