异步执行

//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  阅读(349)  评论(0编辑  收藏  举报