Question

I have a license file that I wish to invalidate if any program other than ours reads the file. My idea is to use File.GetLastAccessedTime(string) and save this value off to the file to be checked when we read the file back in.

However, I am afraid that aside from anti-virus (customers will have to exclude our license file from a scan, I know), there might be windows services or programs that might touch the files and cause the LastAccessed attribute on the file to be updated outside the context of our program, but without malicious intent.

What Windows' programs or services might access this file in the background? Is this a legitimate problem I need to worry about? And if this is something I should be worrying about, are there any common techniques to reliably achieve my end goal?

I am looking for a solution in the .NET 4 world. Thanks in advance for any help with this.

Was it helpful?

Solution

ANy desktop search app. Any virus they get. WIndow's find in files application. All anti-virus and anti-malware tools. A better idea is to cryptographically sign the file to detect alteration of contents, or not to leave a file you're that worried about on the client's machine (download it and use it in ram only).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top