CSharp examples for System.Windows.Forms:Dialog
Shows an error dialog to the user.
using System.Windows.Forms; using System.Collections.Generic; using System.Text; using System.IO;/*from w ww . ja v a2 s . co m*/ using System; public class Main{ /// <summary> /// Shows an error dialog to the user. /// </summary> public static void ShowError(String message) { MessageBox.Show(message, " Error", MessageBoxButtons.OK, MessageBoxIcon.Error); try { String logFile = Path.Combine(PathHelper.LOG_DIR, "Exceptions.log"); File.AppendAllText(logFile, message + "\n\r\n\r"); } catch { /* NO ERRORS */ } } }