系统日志管理:操作者,操作日期,操作描述。系统日志的复合搜索功能。
数据库表T_OperationLog
Id,Operator,MakeDate,ActionDesc
接着在程序相应的地方操作数据库表T_OperationLog
异常处理,一般不使用trycatch捕捉,麻烦,而且可能出现逻辑错误(把错误隐藏或者返回错误的值)。
WPF可以捕捉到全局异常?
在App.xaml输入新的事件DispatcherUnhandledException,点击新建异常处理事件。
App.xaml.cs文件便会产生一个事件Application_DispatcherUnhandledException发生异常将会触发此方法。
privatevoidApplication_DispatcherUnhandledException(objectsender,System.Windows.Threading.DispatcherUnhandledExceptionEventArgse)
{
MessageBox.Show("程序出现异常:"+e.Exception.Message);
e.Handled=true;//值为true时,系统将继续运行,返回到异常前的状态。不为true,程序将崩溃退出
}