开发者

moving a files from one folder to another

开发者 https://www.devze.com 2023-02-12 06:58 出处:网络
I am taking a file with a name of sfile Inmy method I am doing like this way File.Copy(sSFile, Failure + \"\\\\\" + Path.GetFileName(sSFile)) \'\'\'\'\'\'\'\'\'\'FAILURE FOLDER\"\"\"\"\"

I am taking a file with a name of sfile

In my method I am doing like this way

File.Copy(sSFile, Failure + "\\" + Path.GetFileName(sSFile)) ''''''''''FAILURE FOLDER"""""
                fileCounter += 1
File.move(sSFile, BACKup + "\\" + Path.GetFileName(sSFile)) ''''''''''BACKup FOLDER"""""
                fileCounter += 1

where failure and backup are different folders But it iss throw开发者_如何学JAVAing an error : This process is using by some other process


Look at MSDN example. Hope it'll help.


Get the Path First, and then Copy the File, and then do the Same then Move the File.

I am guessing your trying to get the Filename when your already holding on to it to Copy and or Move It.


Use

File.Copy(sSFile, Path.Combine(Failure, Path.GetFileName(sSFile)), bool_overrideflag);

0

精彩评论

暂无评论...
验证码 换一张
取 消