c# - Large Directory/Sub-Directory Data Transfer -


I am trying to write a script to go through a large directory and then copy the files I am trying but the destination can only accept 2 notifications at one time. Is there a way to break transfer from 2 GIG parts to small? I can copy a simple script to the main directory, but the problem is with the destination, all those large transfers will not be accepted at one time. I was thinking about some main function to create sub-functions to transfer data in small areas or sessions in some way but I'm not sure how to do this, but it's divided into sections.

Namespace Console Application 2 {class program {static zero main string [] args) {var source = GetSourceDirectory

itemprop = "text">

(); Var Destination = GetDestinationDirectory ();

  per directory (source, destination); Console.WriteLine ("\ n \ Nfinished."); Console.ReadKey (right); } Fixed directoryInfo GetSourceDirectory () {var Verify = path; Var pathexist = false; Var path = ""; While (! Verification Path) {while (! PathExists) {Console.WriteLine ("Please enter source directory path."); Path = console. Readline (); Console.light line ("confirming directory ..."); PathExists = Directory. Axis (path); If (! PathExists) console WrightLine ("That path does not exist."); } Console.WriteLine ("directory found."); Console.print line ("Please confirm the source file path (Y or N):"); Console.WriteLine (path); VerifyPath = GetVerification (); } Return new directory (path); } Fixed directoryInfo GetDestinationDirectory () {var verifyPath = false; Var path = ""; While (! Verification path) {var pathExists = false; Var createDir = false; While (! PathExists) {Console.WriteLine ("Please enter the destination directory path."); Path = console. Readline (); Console.light line ("confirming directory ..."); PathExists = Directory. Axis (path); If (! PathExists) {Console.WriteLine ("The directory does not exist. Would you like to create it?"); CreateDir = GetVerification (); PathExists = createDir; } Else Console WrightLine ("Directory found."); } Console.WriteLine ("Please verify the source file path (Y or N):"); Console.WriteLine (path); VerifyPath = GetVerification (); If (verified path & createDir) Directory.CreateDirectory (path); } Return new directory (path); } Static Bull GETRYERIFICATION () {char [] VerificationChoices = {'y', 'Y', 'n', 'N'}; Var verifiedChar = Console.ReadKey (). KeyChar; While VerifyChoices.Contains (Verify) Verify = console. Readkey () Couch; Console.Write ("\ n \ n"); Verify by == 'Y' || Verified == 'Y'; } Fixed Zero Directory (DirectoryInfo DirectoryToCopy, DirectoryInfo Destination) {foreach (Sub-SubFolderToCopy.GetDirectories () in the directory) {var SubDestination = Destination.CreateSub Directory (SubFolder.Name); Console WrightLine ("Create Directory:" + SubDestination.FullName); Per directory (subfolder, subdestination); } Varach (DirectoryToCopy.GetFiles () var file {var FullDestinationPath = Destination.FullName + "\\" + file .name + file.extension; File.CopyTo (FullDestinationPath); console.light line ("create file:" + Full-fledged path);}}}   

}

Thanks for the input.


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -