Пример #1
0
        /// <summary>
        /// Moves a file, providing the option to give a new file name.
        /// </summary>
        /// <param name="sourceFileInfo">The file to move.</param>
        /// <param name="destinationFolder">Target directory to move the file.</param>
        /// <remarks>http://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx</remarks>
        public static void Move(QuickIOPathInfo sourceFileInfo, QuickIODirectoryInfo destinationFolder)
        {
            Contract.Requires(sourceFileInfo != null);
            Contract.Requires(destinationFolder != null);

            InternalQuickIO.MoveFile(sourceFileInfo.FullNameUnc, Path.Combine(destinationFolder.FullNameUnc, sourceFileInfo.Name));
        }
Пример #2
0
        /// <summary>
        /// Moves a specified file to a new location, providing the option to give a new file name.
        /// </summary>
        /// <param name="sourceFileName">The name of the file to move. </param>
        /// <param name="destinationFileName">The new path for the file. Parent directory must exist.</param>
        /// <remarks>http://msdn.microsoft.com/en-us/library/system.io.file.move(v=vs.110).aspx</remarks>
        public static void Move(string sourceFileName, string destinationFileName)
        {
            Contract.Requires(!String.IsNullOrWhiteSpace(sourceFileName));
            Contract.Requires(!String.IsNullOrWhiteSpace(destinationFileName));

            InternalQuickIO.MoveFile(sourceFileName, destinationFileName);
        }