Have a quick question. I am using a SQLite database file in my C# application. At the moment it is not password protected. But it will be in case it is needed as a solution for my question.
Question is is there is a way I can check is the SQLite file in associate with my application is a real SQLite file or not. I am doing a,
File.Exists (filepath)
check at the moment which works fine. But it is possible that someone can create a file with my file extension so how can I verify that it is a valid Sqlite file ????
Thanks in advance !
You could check the first 16 bytes in the file:
(from http://www.sqlite.org/fileformat.html)
That is, assuming the password protection doesn’t mess those bytes up too.