Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# move directory

        /// <summary>
        /// Move Directory and files
        /// </summary>
        /// <param name="fromPath"></param>
        /// <param name="toPath"></param>
		Using System.IO;
        public static void Move(string fromPath, string toPath)
        {
            if (string.IsNullOrEmpty(fromPath))
            {
                throw new ArgumentException($"'{nameof(fromPath)}' cannot be null or empty", nameof(fromPath));
            }

            if (string.IsNullOrEmpty(toPath))
            {
                throw new ArgumentException($"'{nameof(toPath)}' cannot be null or empty", nameof(toPath));
            }

            if (!Directory.Exists(fromPath))
            {
                throw new ArgumentException($"'{nameof(fromPath)}' Directory does not exist", nameof(fromPath));
            }
            else
            {
                Directory.Move(fromPath, toPath);
            }
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: commit help 
Csharp :: asp.net core update-database specify environment 
Csharp :: trygetvalue c# 
Csharp :: how to get params our of url c# VB 
Csharp :: unity how to check index of enum 
Csharp :: c# int division to double 
Csharp :: remove all values from list c# 
Csharp :: c# return two values 
Csharp :: c# Write a program to reverse an array or string 
Csharp :: narcissistic 
Csharp :: dotnet create web api 
Csharp :: c# getting response content from post 
Csharp :: how to add arrays in c# 
Csharp :: c# object add property 
Csharp :: asp.net web forms 
Csharp :: raycasting unity 
Csharp :: assert.equal 
Csharp :: addssdawsdawdsdawasdawasdawdswsddsdawssd 
Csharp :: C# ToCsv Extension Method 
Csharp :: c# button click gets assigned the last value 
Csharp :: wpf fixed window size 
Csharp :: wpf button to return to last window 
Csharp :: blazor editform empty 
Csharp :: camera is rendering black screen unity 
Csharp :: c# wpf control to windw size 
Csharp :: v bux free 
Csharp :: asp:button onclick not respond 
Csharp :: c# does readonly improve performance 
Csharp :: cors denied error in asp.net core 
Csharp :: unity soundclip mix 
ADD CONTENT
Topic
Content
Source link
Name
7+4 =