调试时出现以下错误。
发生了未处理的异常
无法完成操作,因为此路径“C:\32bit\abc.dll”中已存在文件
我该如何解决这个问题?
Imports System
Imports System.IO
Public Class Form1
Private Sub ReactorButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReactorButton1.Click
If ReactorComboBox1.SelectedItem = "Some Program" Then
My.Computer.Network.DownloadFile _
("http://somesite/test/abc.dll", _
"C:\32bit\abc.dll", True, 500)
System.IO.File.Move("C:\32bit\abc.dll" "C:\Program Files\Some Program\abc.dll")
My.Computer.Network.DownloadFile _
("http://www.somerandomsite/test1/abcd _
"C:\64bit\abcd.dll", True, 500)
System.IO.File.Move("C:\64bit\abcd.dll… "C:\Program File (x86)\Some Other Program\abcd.dll")
End If
End Sub
我也试过
Try
Catch ex As Exception
System.IO.File.Delete("C:\32bit\abc.dll")
End Try
Try
Catch ex As Exception
My.Computer.Network.DownloadFile _
("http://somesite.com/folder/32bit/abc.dll", _
"C:\32bit\abc.dll", True, 500)
End Try
System.IO.File.Copy("C:\32bit\abc.dll", "C:\Program Files (x86)\A Program\Sub Folder\abc.dll")
但我仍然得到相同的未处理异常错误。