/// <summary>
/// 创建文件
/// </summary>
/// <param name="path">文件路径</param>
/// <param name="content">文件内容</param>
public static void Save(string path, string content)
{
string s = path.Substring(0, path.LastIndexOf('\'));
Directory.CreateDirectory(s);//如果文件夹不存在就创建它
FileStream fs = new FileStream(
path, FileMode.Create,
FileAccess.ReadWrite,
FileShare.ReadWrite
);
byte[] data = System.Text.Encoding.Default.GetBytes(content);
//开始写入
fs.Write(data, 0, data.Length);
//清空缓冲区、关闭流
fs.Flush();
fs.Close();
}