i'm trying to make an updater for a program and i do this by checking the md5 of the file, but it seems that if i try to delete the file after getting the md5 i get an error saying its its being used by another process?
Code:Dim md5 As MD5CryptoServiceProvider = New MD5CryptoServiceProvider Dim f As FileStream = New FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read, 8192) f = New FileStream(filepath, FileMode.Open, FileAccess.Read, FileShare.Read, 8192) md5.ComputeHash(f) Dim hash As Byte() = md5.Hash Dim buff As StringBuilder = New StringBuilder Dim hashByte As Byte For Each hashByte In hash buff.Append(String.Format("{0:x2}", hashByte)) Next f.Close()


Reply With Quote