File.Create("123.txt");
表示在当前应用程序的运行目录下创建一个名称为123.txt的文本文件。
using System.IO;
using (StreamWriter sw = File.AppendText(Application.ExecutablePath+"cache.txt")) //写
{
sw.WriteLine("a line");
sw.Flush();
sw.Close();
}