Esempio n. 1
0
        private void SimpleCheck_Old()
        {
            RecordDataModel data = new RecordDataModel();

            data.gameVersion = gameVersion;
            data.folderDatas = new List <RecordDataModel.FolderDataModel>();

            if (pathSelect.Text.Length == 0)
            {
                return;
            }
            string GamePath = System.IO.Directory.GetParent(pathSelect.Text).ToString();

            if (checkBoxaFFXIV.IsInitialized && (bool)checkBoxaFFXIV.IsChecked)
            {
                string path = GamePath + "\\sqpack\\ffxiv\\";
                //data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (checkBoxaEX1.IsInitialized && (bool)checkBoxaEX1.IsChecked)
            {
                string path = GamePath + "\\sqpack\\ex1\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (checkBoxaEX2.IsInitialized && (bool)checkBoxaEX2.IsChecked)
            {
                string path = GamePath + "\\sqpack\\ex2\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (checkBoxaEX3.IsInitialized && (bool)checkBoxaEX3.IsChecked)
            {
                string path = GamePath + "\\sqpack\\ex3\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            MessageBox.Show("MD5计算完毕");

            string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "\\result.json";

            using (System.IO.StreamWriter file = System.IO.File.CreateText(filePath))
            {
                Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer();
                serializer.Serialize(file, data);
            }
        }
Esempio n. 2
0
        private void SimpleCheck(string GamePath)
        {
            RecordDataModel data = new RecordDataModel();

            data.gameVersion = gameVersion;
            data.folderDatas = new List <RecordDataModel.FolderDataModel>();


            if (ffxiv)
            {
                logger.Info("Starting check ffxiv");
                string path = GamePath + "\\sqpack\\ffxiv\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (ex1)
            {
                logger.Info("Starting check ex1");
                string path = GamePath + "\\sqpack\\ex1\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (ex2)
            {
                logger.Info("Starting check ex2");
                string path = GamePath + "\\sqpack\\ex2\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }
            if (ex3)
            {
                logger.Info("Starting check ex3");
                string path = GamePath + "\\sqpack\\ex3\\";
                data.folderDatas.Add(FileMd5Hash.GetFolderMd5Hash(path));
            }

            string filePath = System.AppDomain.CurrentDomain.BaseDirectory + "\\result.json";

            logger.Info($"save file to {filePath}");
            using (System.IO.StreamWriter file = System.IO.File.CreateText(filePath))
            {
                Newtonsoft.Json.JsonSerializer serializer = new Newtonsoft.Json.JsonSerializer();
                serializer.Serialize(file, data);
            }
        }