string path= System.Windows.Forms.Application.StartupPath + "\\ErrorLog\\"+fileName +".txt"; //æå¼è¿ä¸ªæ件
if (!File.Exists(path))
{
FileInfo myfile = new FileInfo(path);
FileStream fs = myfile.Create();
fs.Close();
}
StreamWriter sw = File.AppendText(path);
sw.WriteLine("åå®æå®ç");//追å è¿ä¸è¡
sw.Flush();
sw.Close();
温馨提示:答案为网友推荐,仅供参考