/// <summary> /// 覆盖源文件,写入text /// </summary> /// <param name="FilePath"></param> /// <param name="Content"></param> public static void WriteUTF8Text(String FilePath, string Content) { try { FloderHelper.FloderExits(FloderHelper.GetFloderPath(FilePath), true); File.WriteAllText(FilePath, Content, Encoding.UTF8); } catch (Exception ex) { PrintLog.Log(ex); } }
/// <summary> /// 移动文件 /// </summary> /// <param name="FilePath"></param> /// <param name="NewFilePath"></param> public static void FileMove(String FilePath, String NewFilePath) { try { FloderHelper.FloderExits(Path.GetDirectoryName(NewFilePath), true); if (File.Exists(NewFilePath)) { NewFilePath = FloderHelper.GetFloderPath(NewFilePath) + DateTime.Now.ToFileTime() + GetFileName(NewFilePath); } File.Move(FilePath, NewFilePath); } catch (Exception ex) { PrintLog.Log(ex); } }