C产品在市场上有哪些独特优势?

2026-05-23 19:131阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计366个文字,预计阅读时间需要2分钟。

C产品在市场上有哪些独特优势?

废话不多说,直接上代码:简单地将类复制到项目中,最后在配置文件上配置一下:logUrl即可。默认保存位置:项目/temp/log // // // summary // // // 日志类 // // // remarksCreator: v-lxh CreateTime

废话不多说,直接上代码:

很简单:将类复制到项目中,最后在配置文件上配置一下:logUrl即可。 默认保存在:项目/temp/log

/// <summary> /// 日志类 /// </summary> /// <remarks>Creator: v-lxh CreateTime: 2016/7/26 11:18:09</remarks> /// <Description></Description> public class Log { /// <summary> /// 写入日志. /// </summary> /// <param name="strList">The STR list.</param> /// <remarks>Creator: v-lxh CreateTime: 2016/7/26 11:18:09</remarks> /// <Description></Description> public static void WriteLog(params object[] strList) { //判断是否开启日志模式 //if (!LogModel) return; if (strList.Count() == 0) return; //日志文件路径 string strDicPath = ""; try { strDicPath = HttpContext.Current.Server.MapPath("~/temp/log/"); if (strDicPath == null || strDicPath == "") { strDicPath = System.Configuration.ConfigurationManager.AppSettings["logUrl"] + "/temp/log/"; } } catch (Exception e) { strDicPath = System.Configuration.ConfigurationManager.AppSettings["logUrl"] + "/temp/log/"; } string strPath = strDicPath + string.Format("{0:yyyy年-MM月-dd日}", DateTime.Now) + "日志记录.txt"; if (!Directory.Exists(strDicPath)) { Directory.CreateDirectory(strDicPath); } if (!File.Exists(strPath)) { using (FileStream fs = File.Create(strPath)) { } } string str = File.ReadAllText(strPath); StringBuilder sb = new StringBuilder(); foreach (var item in strList) { sb.Append("\r\n" + DateTime.Now.ToString() + "-----" + item + ""); } File.WriteAllText(strPath, sb.ToString() + "\r\n-----z-----\r\n" + str); } }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。

C产品在市场上有哪些独特优势?

本文共计366个文字,预计阅读时间需要2分钟。

C产品在市场上有哪些独特优势?

废话不多说,直接上代码:简单地将类复制到项目中,最后在配置文件上配置一下:logUrl即可。默认保存位置:项目/temp/log // // // summary // // // 日志类 // // // remarksCreator: v-lxh CreateTime

废话不多说,直接上代码:

很简单:将类复制到项目中,最后在配置文件上配置一下:logUrl即可。 默认保存在:项目/temp/log

/// <summary> /// 日志类 /// </summary> /// <remarks>Creator: v-lxh CreateTime: 2016/7/26 11:18:09</remarks> /// <Description></Description> public class Log { /// <summary> /// 写入日志. /// </summary> /// <param name="strList">The STR list.</param> /// <remarks>Creator: v-lxh CreateTime: 2016/7/26 11:18:09</remarks> /// <Description></Description> public static void WriteLog(params object[] strList) { //判断是否开启日志模式 //if (!LogModel) return; if (strList.Count() == 0) return; //日志文件路径 string strDicPath = ""; try { strDicPath = HttpContext.Current.Server.MapPath("~/temp/log/"); if (strDicPath == null || strDicPath == "") { strDicPath = System.Configuration.ConfigurationManager.AppSettings["logUrl"] + "/temp/log/"; } } catch (Exception e) { strDicPath = System.Configuration.ConfigurationManager.AppSettings["logUrl"] + "/temp/log/"; } string strPath = strDicPath + string.Format("{0:yyyy年-MM月-dd日}", DateTime.Now) + "日志记录.txt"; if (!Directory.Exists(strDicPath)) { Directory.CreateDirectory(strDicPath); } if (!File.Exists(strPath)) { using (FileStream fs = File.Create(strPath)) { } } string str = File.ReadAllText(strPath); StringBuilder sb = new StringBuilder(); foreach (var item in strList) { sb.Append("\r\n" + DateTime.Now.ToString() + "-----" + item + ""); } File.WriteAllText(strPath, sb.ToString() + "\r\n-----z-----\r\n" + str); } }

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持易盾网络。

C产品在市场上有哪些独特优势?