winform错误信息提示的代码
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;
using System.Text;
namespace fangqm.NetBank.UI
{
class ErrorHandler
{
internal static void OnError(Exception ex)
{
if (ex.GetType() == typeof(ApplicationException) ||
ex.GetType().IsSubclassOf(typeof(ApplicationException)))
{
System.Windows.Forms.MessageBox.Show(
ex.Message, "提示信息!",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Information);
}
else
{
System.Windows.Forms.MessageBox.Show(
ex.Message + "\r\n\r\n" + ex.StackTrace, "系统错误!",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error);
}
}
{
class ErrorHandler
{
internal static void OnError(Exception ex)
{
if (ex.GetType() == typeof(ApplicationException) ||
ex.GetType().IsSubclassOf(typeof(ApplicationException)))
{
System.Windows.Forms.MessageBox.Show(
ex.Message, "提示信息!",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Information);
}
else
{
System.Windows.Forms.MessageBox.Show(
ex.Message + "\r\n\r\n" + ex.StackTrace, "系统错误!",
System.Windows.Forms.MessageBoxButtons.OK,
System.Windows.Forms.MessageBoxIcon.Error);
}
}
}
}
}
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23109131/viewspace-630980/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23109131/viewspace-630980/