2016-09-15 32 views
0

我正在嘗試用ZXing編寫一個程序,它不斷掃描鍵盤輸入,將輸入轉換爲QR碼。然後使用BarcodeReader類讀取此QR碼。即使在包含對象的子例程完成之後,BarcodeReader也會爲該文件保留資源。這可以防止我能夠保存新的QR碼,因爲它仍在使用中,所以會覆蓋現有的QR碼!爲了解決這個問題,我試圖調用這個類的析構函數,但是我沒有找到。任何有關這個問題的幫助將不勝感激。下面的代碼是應該調用析構函數的地方。ZXing條碼編寫器破解器

'Read any 2D Barcode, this will only ever be a QR code for this project 
Private Function read2D(location As String) 
    Dim reader = New ZXing.BarcodeReader() 
    Try 
     Dim result = reader.Decode(Bitmap.FromFile(location)) 
     Return "Succesfully Read 2D Barcode:" + result.ToString 
    Catch ex As Exception 
     Return "Error Reading 2D Barcode" 
    End Try 
End Function 

回答