Esempio n. 1
0
        static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
        {
            //MessageBox.Show(e.Exception.Message);
            //Logger.Instance().Error(e.Exception.Message, e.Exception);
            string mTitle      = "系统错误";
            string mObjectName = SuperBaseClass.uError.GetMethodInfo();
            string mDisp       = "系统错误";
            string mErrMsg     = e.Exception.Message + "\r\n" + e.Exception.StackTrace;
            string mExErrMsg   = e.Exception.TargetSite + "\r\n" + e.Exception.InnerException;

            SuperBaseClass.uMessageBox mMessageBox = new SuperBaseClass.uMessageBox(mTitle, mObjectName, mDisp, mErrMsg, mExErrMsg);

            mMessageBox.ShowDialog();
        }
Esempio n. 2
0
        //出错处理
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            //MessageBox.Show((e.ExceptionObject as Exception).Message);
            //Logger.Instance().Error(e.ExceptionObject);
            string mTitle      = "系统错误";
            string mObjectName = SuperBaseClass.uError.GetMethodInfo();
            string mDisp       = "系统错误";
            string mErrMsg     = (e.ExceptionObject as Exception).Message + "\r\n" + (e.ExceptionObject as Exception).StackTrace;
            string mExErrMsg   = (e.ExceptionObject as Exception).TargetSite + "\r\n" + (e.ExceptionObject as Exception).InnerException;

            SuperBaseClass.uMessageBox mMessageBox = new SuperBaseClass.uMessageBox(mTitle, mObjectName, mDisp, mErrMsg, mExErrMsg);

            mMessageBox.ShowDialog( );
        }