码迷,mamicode.com
首页 > 其他好文 > 详细

生成Log文件的写法

时间:2017-08-30 13:07:54      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:iter   string   close   tostring   writer   use   username   path   datetime   

System.IO.StreamWriter w = new System.IO.StreamWriter(Server.MapPath("~/App_data/xxx.log"), true);
w.WriteLine(DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + " IP:" + clientIp + " UserName:" + this.Login1.UserName);
w.Close();

生成Log文件的写法

标签:iter   string   close   tostring   writer   use   username   path   datetime   

原文地址:http://www.cnblogs.com/huangjing/p/7452423.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!