文件操作

一、创建文件,删除文件

           //创建文件
            string iniPath = @"D:12.txt";
            if (!System.IO.File.Exists(iniPath))
            {
                using (StreamWriter sw = new StreamWriter(iniPath, false, Encoding.UTF8))
                {
                    sw.Write(iniPath);
                }
            }
            //删除文件
            if (System.IO.File.Exists(iniPath))
            {
                System.IO.File.Delete(iniPath);
            }
原文地址:https://www.cnblogs.com/macT/p/11454039.html