Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 7th, 2012  |  syntax: None  |  size: 0.98 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. FolderBrowserDialog crashes the application
  2. try
  3. {
  4.     FolderBrowserDialog fbd = new FolderBrowserDialog();
  5.     fbd.RootFolder = Environment.SpecialFolder.Desktop;
  6.     if (fbd.ShowDialog() == DialogResult.OK)
  7.     {
  8.         //  this.Minecraft.Text = fbd.SelectedPath;
  9.     }
  10. }
  11. catch
  12. {
  13. }
  14.        
  15. AppDomain.CurrentDomain.FirstChanceException += (sender, e) =>
  16.         {
  17.             if ((e == null) || (e.Exception == null))
  18.             {
  19.                 return;
  20.             }
  21.  
  22.             using (var sw = File.AppendText(@".exceptions.txt"))
  23.             {
  24.                 sw.WriteLine(e.ExceptionObject);
  25.             }                
  26.         };
  27.  
  28.         AppDomain.CurrentDomain.UnhandledException += (sender, e) =>
  29.         {
  30.             if ((e == null) || (e.ExceptionObject == null))
  31.             {
  32.                 return;
  33.             }
  34.  
  35.             using (var sw = File.AppendText(@".exceptions.txt"))
  36.             {
  37.                 sw.WriteLine(e.ExceptionObject);
  38.             }                
  39.         };