I am deploying a file along with a C# application. And I want to make sure that file is same as it was supplied otherwise the C# application will show error. Now, a file's creation and modification date can be changed after it is modified. Is there any checksum/hash etc. in C# to make sure file is not changed by user.
Asked
Active
Viewed 3,630 times
-4
-
1Don't bother. The user can simply change your application to skip the check. – SLaks Jan 01 '16 at 20:13
1 Answers
6
Yes, you could for instance use SHA1 to get a hash that you hard-code into the app and check the file against. But if you don't want the file to ever change, it would probably make more sense to simply build the file into the .exe as an embedded resource and read it directly from the .exe rather than from the filesystem.

adv12
- 8,443
- 2
- 24
- 48