File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed
snippets/csharp/VS_Snippets_VBCSharp/csFilesAndFolders/CS Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -442,12 +442,10 @@ static void Main()
442442 string destFile = System . IO . Path . Combine ( targetPath , fileName ) ;
443443
444444 // To copy a folder's contents to a new location:
445- // Create a new target folder, if necessary.
446- if ( ! System . IO . Directory . Exists ( targetPath ) )
447- {
448- System . IO . Directory . CreateDirectory ( targetPath ) ;
449- }
450-
445+ // Create a new target folder.
446+ // If the directory already exists, this method does not create a new directory.
447+ System . IO . Directory . CreateDirectory ( targetPath ) ;
448+
451449 // To copy a file to another location and
452450 // overwrite the destination file if it already exists.
453451 System . IO . File . Copy ( sourceFile , destFile , true ) ;
You can’t perform that action at this time.
0 commit comments