hutongqing
2024-08-21 cb683bbc5db174d236fafd35e833993201a3bad2
WIDESEAWCS_Server/WIDESEAWCS_Core/Helper/FileHelper.cs
@@ -124,11 +124,34 @@
                FileStream f = File.Create(Path);
                f.Close();
            }
            StreamWriter f2 = new StreamWriter(Path, false, System.Text.Encoding.GetEncoding("gb2312"));
            StreamWriter f2 = new StreamWriter(Path, false, System.Text.Encoding.UTF8);
            f2.Write(Strings);
            f2.Close();
            f2.Dispose();
        }
        /// <summary>
        /// 写文件
        /// </summary>
        /// <param name="Path">文件路径</param>
        /// <param name="Strings">文件内容</param>
        public static void WriteFileAndDelOldFile(string Path, string Strings)
        {
            if (!File.Exists(Path))
            {
                FileStream f = File.Create(Path);
                f.Close();
            }
            else
            {
                File.Delete(Path);
            }
            StreamWriter f2 = new StreamWriter(Path, false, System.Text.Encoding.UTF8);
            f2.Write(Strings);
            f2.Close();
            f2.Dispose();
        }
        /// <summary>
        /// 写文件
        /// </summary>