异步执行

//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();
        }
异步执行

 

posted @ 2019-03-15 10:30 756001160 阅读(...) 评论(...) 编辑 收藏