C# 创建文件
public void createHtml(string fileName, string path) { path = System.IO.Path.Combine(path, fileName); Console.WriteLine("Path to my file: {0}\n", path); if (!System.IO.File.Exists(path)) { using (System.IO.FileStream fs = System.IO.File.Create(path)); } else { Console.WriteLine("File \"{0}\" already exists.", fileName); return; } }