1.使用DirectoryInfo.MoveTo时,将目标文件夹一定要是不存在,不然报错。

 代码如下:

1    string path = @"c:\wtqCreate";
2             string pathTxt = path + @"\my.txt";
3             string wtqPath = @"c:\wtq";
4             string wttqq = @"c:\wttq11";
5             DirectoryInfo di = new DirectoryInfo(path);
6             di.MoveTo(wttqq);

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
  • 2022-01-14
  • 2022-12-23
  • 2022-02-06
相关资源
相似解决方案