我使用System.IO.File.Copy从serverA的文件复制到ServerB。这工作正常接受文件exsist我得到一个错误“文件已存在”。我尝试使用file.exsist捕获它,但没有任何内容。文件已经存在使用system.io.file.copy
这里是我的代码。
'Save files to disk
FileUpload1.SaveAs(Server.MapPath("../pdf/audits/" & FileName))
'Local Server
Dim localPath As String = "\\server01\folder1$\pdf\audits\"
'Remote Server
Dim remotePath As String = "\\server02\folder2$\pdf\audits\"
System.IO.File.Copy(localPath + FileName, remotePath + FileName)
我缺少什么?
什么是错误您收到? – Tariqulazam
http://msdn.microsoft.com/en-us/library/system.io.file.copy.aspx – jrummell
对不起错误是在我的主题行“文件已经存在” – Gee