简体   繁体   English

将文件从临时文件夹复制到浏览位置

[英]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 ).我想将一个 zip 文件从临时文件夹复制到浏览位置(比如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"); System.IO.File.Copy(@"c:\\temp\\file.zip", @"c:\\destination\\file.zip");

Which kind of exception you receive?您收到哪种异常?

Msdn documentation msdn 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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