Example #1
0
        ///   <summary>
        ///   获取文件的 CRC 校验码
        ///   </summary>
        ///   <param   name="file"></param>
        ///   <returns></returns>
        public static uint GetFileCRC(string file)
        {
            using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                CrcStream    crcStream = new CrcStream(fs);
                StreamReader reader    = new StreamReader(crcStream);
                reader.ReadToEnd();

                return(crcStream.ReadCrc);
            }
        }
Example #2
0
        ///   <summary>   
        ///   获取文件的 CRC 校验码   
        ///   </summary>   
        ///   <param   name="file"></param>   
        ///   <returns></returns>   
        public static uint GetFileCRC(string file)
        {
            using (FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.Read))
            {
                CrcStream crcStream = new CrcStream(fs);
                StreamReader reader = new StreamReader(crcStream);
                reader.ReadToEnd();

                return crcStream.ReadCrc;
            }
        }