VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,580 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
I have a file stored in my app as a resource: My.Resources.blah.blah
Need to compare it against a file on disk without writing it to disk (WriteAllBytes) in memory to check if both files are identical or difference (like FC.exe)
In short: 1st file is in resources, 2nd file on disk, compare them without saving the 1st file.
Any built-in method in .NET or if not what's the suggestion?
Thanks all :)
You can compare Bytes Arrays of the 2 files
Something like :
Dim byteFileResources As Byte() = My.Resources.YourFile
Dim sFile = "E:\YourFile.exe"
Dim byteFile As Byte() = File.ReadAllBytes(sFile)
Dim bRet = StructuralComparisons.StructuralEqualityComparer.Equals(byteFileResources, byteFile)