Changeset 75 for trunk/MacFaceFloat/MacFaceApp.cs
- Timestamp:
- Jul 12, 2006, 10:09:57 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MacFaceFloat/MacFaceApp.cs
r73 r75 44 44 public static void Main(string[] args) 45 45 { 46 AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); 46 47 MacFaceApp app = new MacFaceApp(); 47 48 app.StartApplication(); … … 403 404 window.Show(); 404 405 } 406 407 /// <summary> 408 /// nh³êĢȢáOðLb`µÄAX^bNg[XðÛ¶µÄfobOÉð§Äé 409 /// </summary> 410 /// <param name="sender"></param> 411 /// <param name="e"></param> 412 private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) 413 { 414 Exception ex = e.ExceptionObject as Exception; // Exception ÈOªòñÅéÌÍ´ÁêÈêÌÝB 415 416 if (MessageBox.Show( 417 String.Format("AvP[VÌÀsÉ\úµÈ¢dåÈG[ª¶µÜµ½B\n\nG[àe:\n{0}\n\nG[îñðt@CÉÛ¶µAñµÄ¢½¾±ÆÅsïÌðÉð§ÂÂ\«ª èÜ·BG[îñðt@CÉÛ¶µÜ·©?", 418 ((Exception)(e.ExceptionObject)).Message) 419 , Application.ProductName 420 , MessageBoxButtons.YesNo 421 , MessageBoxIcon.Error 422 , MessageBoxDefaultButton.Button1 423 ) == DialogResult.Yes) 424 { 425 using (SaveFileDialog saveFileDialog = new SaveFileDialog()) 426 { 427 saveFileDialog.DefaultExt = "txt"; 428 saveFileDialog.Filter = "eLXgt@C|*.txt"; 429 saveFileDialog.FileName = String.Format("macface4win_stacktrace_{0:yyyyMMdd_HHmmss}.txt", DateTime.Now); 430 if (saveFileDialog.ShowDialog() == DialogResult.OK) 431 { 432 using (Stream stream = saveFileDialog.OpenFile()) 433 using (StreamWriter sw = new StreamWriter(stream)) 434 { 435 sw.WriteLine("¶: {0}", DateTime.Now); 436 sw.WriteLine(); 437 sw.WriteLine("MacFace for Windows:"); 438 sw.WriteLine("========================"); 439 sw.WriteLine("o[W: {0}", Application.ProductVersion); 440 sw.WriteLine("AZu: {0}", Assembly.GetExecutingAssembly().FullName); 441 sw.WriteLine(); 442 sw.WriteLine("«îñ:"); 443 sw.WriteLine("========================"); 444 sw.WriteLine("Iy[eBOVXe: {0}", Environment.OSVersion); 445 sw.WriteLine("Microsoft .NET Framework: {0}", Environment.Version); 446 sw.WriteLine(); 447 sw.WriteLine("nh³êĢȢáO: "); 448 sw.WriteLine("========================="); 449 sw.WriteLine(ex.ToString()); 450 } 451 } 452 } 453 454 } 455 } 405 456 } 406 457 }
Note: See TracChangeset
for help on using the changeset viewer.