Пример #1
0
        /// <summary>
        /// 复制文件夹
        /// </summary>
        /// <param name="oldFile">原文件地址</param>
        /// <param name="newFile">新文件名称</param>
        public static void fileReNameCmd(string oldFile, string newFile)
        {
            if (string.IsNullOrEmpty(oldFile) || string.IsNullOrEmpty(newFile))
            {
                return;
            }
            oldFile = oldFile.Replace("/", "\\");
            newFile = newFile.Replace("/", "\\");
            string sCmd = @"ren /y " + oldFile + " " + newFile;

            ExcuteCmd.Execute(sCmd);
        }
Пример #2
0
        /// <summary>
        /// 复制文件夹
        /// </summary>
        /// <param name="oldFile">原文件地址</param>
        /// <param name="newFilePath">新文件路径/新文件名称</param>
        /// <param name="overwrite">是否覆盖</param>
        public static void fileCopyCmd(string oldFile, string newFilePath, bool overwrite)
        {
            if (string.IsNullOrEmpty(oldFile) || string.IsNullOrEmpty(newFilePath))
            {
                return;
            }
            oldFile     = oldFile.Replace("/", "\\").Replace("\\\\", "\\");
            newFilePath = newFilePath.Replace("/", "\\").Replace("\\\\", "\\");
            string route = newFilePath.Substring(0, newFilePath.LastIndexOf("\\"));

            if (!Directory.Exists(route))
            {
                Directory.CreateDirectory(route);
            }
            string sCmd = @"copy " + (overwrite ? "/y " : "") + oldFile + " " + newFilePath;

            ExcuteCmd.Execute(sCmd);
        }
Пример #3
0
        public static void ConvertToMp3(string pathBefore, string pathLater)
        {
            string c = GenericData.BaseDirectory + "utilityClass/ffmpeg/" + @"ffmpeg.exe -i /y " + pathBefore + " " + pathLater;

            ExcuteCmd.Execute(c);
        }