try { } catch(Exception ex) { //MessageBox.Show("","窗口") string type = ex.GetType();//类型 string message = ex.Message;//信息 MessageBox.Show(ex.StackTrace,"堆栈跟踪"); return; }