c# - Runtime error 'Could not find a part of the path' E:\ -
I tried copy folder from flash disk to Path E: \ debug \ VIP This problem Have any idea about? Here's my code: Use to join the paths. For example c: directory. Sometimes it's running properly, but sometimes I get an error:
string source_dir = "E: \\ debug \\ Vip"; String destination_dir = "C: \\ Vip"; If (! System.IO.Directory.Exists (destination_dir)) {System.IO.Directory.CreateDirectory (destination_dir); } // sub-location destination_dir is to remove the full path (e: \). // Directory Create sub-directory structure in Destination Forex (Directory_dir + dir.Substring (source_dir.Length)) in the gate directory (Source_Dire, "*", System.IOS Searchoption.All Directories);} Foreach (string file_name Directory.GetFiles (source_dir, "*. *", System.IO.SearchOption.All Directories)) {File.Copy (file_name, destination_dir + file_name.Substring (source_dir.Length), true);}
directory Naaa Directory (System.IO.Path.Combine (destination_dir, dir.Substring (source_dir.Length)));
Comments
Post a Comment