예제 #1
0
 static void Main(string[] args)
 {
     //Application.Run(new FormMain());
     try
     {
         if (args.Length > 0)
         {
             Application.Run(new FormMain(args[0]));
         }
         else
         {
             Application.Run(new FormMain(null));
         }
     }
     catch (Exception ex)
     {
         ErrorFile.Save(ex);
         SystemFile.Save((int.Parse(SystemFile.Get(3)) + 1).ToString(), 3);
         throw ex;
     }
 }
예제 #2
0
 public DialogResult Show(MessageBoxButtons buttons, string text, Exception ex, Form form)
 {
     if (form == null)
     {
         StartPosition = FormStartPosition.CenterScreen;
     }
     else
     {
         StartPosition = FormStartPosition.Manual;
         Left          = form.Left + form.Width / 2 - Width / 2;
         Top           = form.Top + form.Height / 2 - Height / 2;
     }
     richTextBox1.WordWrap = false;
     Text = text;
     KhongBietDatTenSaoLuon(buttons, text + "\n" + ex.Message + "\n" + ex.StackTrace);
     //lưu số lần bị lỗi vào file "System.ini"
     SystemFile.Save((int.Parse(SystemFile.Get(3)) + 1).ToString(), 3);
     ErrorFile.Save(ex);
     //
     return((DialogResult)returner);
 }