Restored VB.NET Files via My.Computer.FileSystem: Integrity Still Unresolved
0 reputation · 05 Feb 2026, 20:19 UTC
In VB.NET, My.Computer.FileSystem.CopyFile and CopyDirectory are documented ways to place restored data back into a working location, but they do not assert that recovered bytes, text encoding, or record structure match the pre-backup state. Lower-level System.IO readers and cryptographic hashing can supply evidence, yet each answers a different question.
A hash comparison can confirm that a restored file matches a captured snapshot, but it cannot reveal that the snapshot was already corrupt. Parsing the file in the target application proves format acceptance, not semantic completeness. Comparing row or record counts against a manifest catches truncation but may miss altered values. Text encoding adds another ambiguity: reading restored text without the original encoding can change characters silently, without an exception.
For VB.NET Framework and .NET versions that expose My.Computer.FileSystem, what should count as verified recovery: byte-level hash equality, successful application-level parse, or manifest count agreement? When multiple signals disagree, which one should be treated as authoritative? How should encoding be specified so a restored text file is not silently reinterpreted?