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

信息写入记事本方法

时间:2014-05-15 17:51:53      阅读:262      评论:0      收藏:0      [点我收藏+]

标签:c   ext   a   string   line   name   

/// <summary>
/// 信息写入记事本
/// </summary>
/// <param name="text"></param>
/// <param name="path"></param>
public static void Write(string text, string path)
{
try
{
DateTime newDate = DateTime.Now;
string msg = newDate.ToLongTimeString() + ":" + text;
StreamWriter sw = File.AppendText(path);
sw.WriteLine(msg);
sw.Flush();
sw.Close();

}
catch (Exception ex)
{
throw ex;
}
}

信息写入记事本方法,布布扣,bubuko.com

信息写入记事本方法

标签:c   ext   a   string   line   name   

原文地址:http://www.cnblogs.com/ChineseMoonGod/p/3729842.html

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