.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();
}

 

}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章