File.Move Does Not Work - File Already Exists

前端 未结 9 1227
无人及你
无人及你 2020-12-04 12:08

I\'ve got a folder:

c:\\test

I\'m trying this code:

File.Move(@\"c:\\test\\SomeFile.txt\", @\"c:\\test\\Test\");         


        
9条回答
  •  我在风中等你
    2020-12-04 12:34

    According to the docs for File.Move there is no "overwrite if exists" parameter. You tried to specify the destination folder, but you have to give the full file specification.

    Reading the docs again ("providing the option to specify a new file name"), I think, adding a backslash to the destination folder spec may work.

提交回复
热议问题