.Net普通记事本记载日志

/// <summary>
/// 记日志
/// </summary>
/// <param name="str"></param>
public void LogWrit(string str)
{
string SqlFileName = "1.txt";

string pluPath = AppDomain.CurrentDomain.BaseDirectory + "1.txt";//plu文件路径

if (File.Exists(pluPath))
{
File.Delete(pluPath);

using (StreamWriter sw = new StreamWriter(pluPath, false, Encoding.GetEncoding("GB2312")))
{
sw.Write(str);
sw.Close();
}

 

}

posted @ 2022-01-07 11:33  LowKeyC  阅读(53)  评论(0编辑  收藏  举报
有志者事竟成破釜沉舟百二秦关终属楚苦心人,天不负,卧薪尝胆,三千越甲可吞吴