我尝试复制服务器文件夹中的文件时遇到问题。我的代码上周工作得很好,但是没有出现这样的错误:
我的代码是:
FileToCopy = strfilePath
NewCopy ="\\artfs02\07_ART_ECO\12_Samples\03_Samples_order\01_Samples_BOMs_&_DRW\" & strFileName
...
Try
If System.IO.File.Exists(FileToCopy) = True Then
System.IO.File.Copy(FileToCopy, NewCopy, True)
Else
LBL_ERR.Text = "There is no file to be copied !"
GC.Collect()
Exit Sub
End If
Catch ex As Exception
LBL_ERR.Text = "Failed to replace file! Parts were booked from Warehouse !"
GC.Collect()
Exit Sub
End Try