c# db4o checking for the right database file -


i'm writing small app uses db4o database.

i want choose database file disk , load stuff (classes, fields, etc.). problem how check file db4o file?

for example, choose not correct db4o file (for ex. .txt file or another) - how check file has db4o stuff inside? can't check files extensions, because won't work (i have few files extension .yap, few extension, few files no extension , files load correctly)

sorry text, maybe understand want achieve. me?

why dont make method check exception , try putting inside try ... catch ... block , catch (for example)

    public bool checkdb4ofile(string filename)     {         try         {             using (iobjectcontainer container = db4ofactory.openfile(filename))             {                 // nothong;             }             return true;         }         catch         {             return false;         }      } 

Comments