Esempio n. 1
0
        public static FileVersionInfo GetVersionInfoByFile(string _parentPath, string _filePath, string _moduleName)
        {
            FileVersionInfo info         = new FileVersionInfo();
            int             parentDirLen = _parentPath.Length;
            FileInfo        finfo        = new FileInfo(_filePath);
            long            outLength;
            var             suburl = _filePath.Substring(parentDirLen);
            MD5             md5    = new MD5CryptoServiceProvider();
            var             strMd5 = EAssetBundleToolUtil.GetMD5(md5, _filePath, out outLength);

            info.Size         = outLength;
            info.MD5          = strMd5;
            info.FileName     = finfo.Name;
            info.RelativePath = suburl;
            info.ModuleName   = _moduleName;
            //md5.Dispose();
            return(info);
        }
Esempio n. 2
0
        public static List <FileVersionInfo> GetVersionListOfModule(string _parentPath, string _inputPath, string _moduleName, string _searchPattern)
        {
            List <FileVersionInfo> result = new List <FileVersionInfo>();
            var files        = Directory.GetFiles(_inputPath, _searchPattern, SearchOption.AllDirectories);
            int parentDirLen = _parentPath.Length;
            MD5 md5          = new MD5CryptoServiceProvider();

            foreach (var v in  files)
            {
                FileVersionInfo info  = new FileVersionInfo();
                FileInfo        finfo = new FileInfo(v);
                long            outLength;
                var             suburl = v.Substring(parentDirLen);
                var             strMd5 = EAssetBundleToolUtil.GetMD5(md5, v, out outLength);
                info.Size         = outLength;
                info.MD5          = strMd5;
                info.FileName     = finfo.Name;
                info.RelativePath = suburl;
                info.ModuleName   = _moduleName;
                result.Add(info);
            }
            return(result);
        }