异步执行


//BS架构下的异步执行文件

     public delegate void NotifyExamDelegate(int SingleCount);


    AsyncSendEmailToUser(0); 


     void AsyncSendEmailToUser(int SingleCount)
        {
            NotifyExamDelegate del = new NotifyExamDelegate(SendEmailToUser);
            IAsyncResult ar = del.BeginInvoke(SingleCount, new AsyncCallback(CallbackMethod), del);
        }

        void CallbackMethod(IAsyncResult ar)
        {
            NotifyExamDelegate del = (NotifyExamDelegate)ar.AsyncState;
            del.EndInvoke(ar);
        }

    public void SendEmailToUser(int num)
        { 
            bool flag = bll.Insert_HR_Exam_User();
        }
异步执行

 


作者:756001160,发布于:2019/03/15
原文:https://www.cnblogs.com/zhangjie6/p/10535403.html