Example #1
0
        /// <summary>
        /// 从输出目录加载补丁清单文件
        /// </summary>
        private PatchManifest LoadPatchManifestFile()
        {
            string        filePath  = $"{OutputPath}/{PatchDefine.PatchManifestBytesFileName}";
            PatchManifest patchFile = new PatchManifest();

            // 如果文件不存在
            if (File.Exists(filePath) == false)
            {
                return(patchFile);
            }

            byte[] fileData = File.ReadAllBytes(filePath);
            patchFile.Parse(fileData);
            return(patchFile);
        }
        /// <summary>
        /// 从输出目录加载补丁清单文件
        /// </summary>
        private PatchManifest LoadPatchManifestFile()
        {
            string filePath = $"{OutputPath}/{PatchDefine.PatchManifestFileName}";

            PatchManifest patchFile = new PatchManifest();

            // 如果文件不存在
            if (File.Exists(filePath) == false)
            {
                return(patchFile);
            }

            using (FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read))
            {
                StreamReader sr = new StreamReader(fs);
                patchFile.Parse(sr);
                sr.Close();
                fs.Close();
            }

            return(patchFile);
        }