DemoCommon.BinaryTable.IsValid C# (CSharp) Method

IsValid() public static method

public static IsValid ( string file ) : bool
file string
return bool
        public static bool IsValid(string file)
        {
            bool ret = false;
            try {
                using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read)) {
                    FileHeader header = ReadFileHeader(fs);
                    if (header.m_Identity == c_Identity && header.m_Version == c_Version) {
                        ret = true;
                    }
                    fs.Close();
                }
            } catch (Exception ex) {
                LogSystem.Error("Exception:{0}\n{1}", ex.Message, ex.StackTrace);
            }
            return ret;
        }