简体   繁体   中英

Copy a file from temp folder to a browsed location

I want to copy a zip file from temp folder to a browsed location (say Destinydirectory ).

This is my code however it gives me an error:

If System.IO.Directory.Exists(My.Computer.FileSystem.CombinePath(My.Computer.FileSystem.SpecialDirectories.Temp, "IXP001.TMP")) Then
    System.IO.Directory.Delete(My.Computer.FileSystem.CombinePath(My.Computer.FileSystem.SpecialDirectories.Temp, "IXP000.TMP"), True)
    FileCopy = "c:\\Users\\Test\\AppData\\Local\\Temp\\IXP001.TMP\\bin.zip"
Else
    FileCopy = "c:\\Users\\Test\\AppData\\Local\\Temp\\IXP000.TMP\\bin.zip"
End If
File.Copy(FileCopy, Destinydirectory)

This is the code:

System.IO.File.Copy(@"c:\\temp\\file.zip", @"c:\\destination\\file.zip");

Which kind of exception you receive?

Msdn documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM