0

图像文件没有被释放,并且 MoveFile 得到一个异常,指出该文件正在使用中:

    Dim fileLeft As String
    Dim fileCopy As String
    ' --- image in PicBoxLeft is PD-TN-1234.tif
    Me.PicBoxLeft.Image.Dispose()
    Me.PicBoxLeft.Image = Nothing
    fileLeft = TNpath + "\PD-TN-1234.tif" 
    fileCopy = "C:\AuditBook\Temp\" + "PD-TN-1234.tif" 
    My.Computer.FileSystem.MoveFile(fileLeft, fileCopy, True

CopyFile 似乎可以使用相同的“.Dispose()”和“= Nothing”处理图像文件。为什么不释放图像文件以便 MoveFile 工作?

4

0 回答 0