예제 #1
0
        /// <summary>
        /// 将字节数组bytes保存到指定路径文件
        /// </summary>
        /// <param name="bytes"></param>
        /// <param name="FilePath"></param>
        public static void saveFileFromStream(byte[] bytes, string filePath)
        {
            string folder = filePath.Substring(0, filePath.LastIndexOf("/") + 1);

            CreateNewFolder(folder);
            Stream stream = FileByteStreamConvert.BytesToStream(bytes);

            FileByteStreamConvert.StreamToFile(stream, filePath);
        }
예제 #2
0
        /// <summary>
        /// �Ա����ص��ļ���CRC������������ļ���CRC���Ƿ�һ��
        /// </summary>
        /// <param name="FilePath">�Ա��ļ�·��</param>
        /// <returns></returns>
        public bool verifyFileExists(string filePath, uint crc)
        {
            if (!FileByteStreamConvert.IsExists(filePath))
            {
                return(false);
            }
            uint crcNew = Crc32.GetFileCRC32(filePath);

            if (crcNew == crc)
            {
                return(true);
            }
            return(false);
        }