C# 创建文件

 public void createHtml(string fileName, string path)
        {
            path = System.IO.Path.Combine(path, fileName);
            Console.WriteLine("Path to my file: {0}
", 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;
            }
        }
原文地址:https://www.cnblogs.com/tangpeng97/p/7838306.html