The best way to move a directory with all its contents(files or folders) in C#?

后端 未结 6 1845
萌比男神i
萌比男神i 2021-01-16 16:55

What is the best way to move directory with all its contents(files or folders) in C#?

I used the following codes, but it throws The Directory is not empty

6条回答
  •  感情败类
    2021-01-16 17:38

    Use System.Io.

    string source = @"c:\new";
    string dest = @"c:\newnew";
    Directory.Move(source, dest);
    

提交回复
热议问题