/// <summary> /// 日志写入方法 /// </summary> /// <param name="str"></param> public void SaveLogs(string username, string str) { SystemLogBLL bll = new SystemLogBLL(); SystemLog model = new SystemLog(); model.UserName = username; model.IpAddress = Utils.GetTrueIPAddress(); model.LogInfo = str; bll.AddLog(model); }
/// <summary> /// 日志写入方法 /// </summary> /// <param name="str"></param> protected void SaveLogs(string str) { SystemLogBLL bll = new SystemLogBLL(); SystemLog model = new SystemLog(); if (Session["AdminName"] != null) { model.UserName = Session["AdminName"].ToString(); } model.IpAddress = Utils.GetTrueIPAddress(); model.LogInfo = str; bll.AddLog(model); }