private void frmMain_FormClosing(object sender, FormClosingEventArgs e) { try { BLLOPERATORLOG BLLOPERATORLOG = new BLLOPERATORLOG(); MODELOPERATORLOG MODELOPERATORLOG = new MODELOPERATORLOG(); MODELOPERATORLOG.LOGCONTENT = "用户:" + strLogID + "-" + strUserName + "退出"; //MODELOPERATORLOG.METERREADINGID = cmbWaterUserMeterReadingNO.SelectedValue.ToString(); MODELOPERATORLOG.LOGTYPE = "5"; //5登陆日志 MODELOPERATORLOG.OPERATORID = strLogID; MODELOPERATORLOG.OPERATORNAME = strUserName; BLLOPERATORLOG.Insert(MODELOPERATORLOG); } catch (Exception ex) { } }