Exemple #1
0
        public static void LoadConfig()
        {
            OCR_API_KEY    = INIOperation.ReadValue("config.ini", "BaiDuOCR", "API_KEY", "0kEPZddCBO5cUD0Lf1yTN91O");
            OCR_SECRET_KEY = INIOperation.ReadValue("config.ini", "BaiDuOCR", "SECRET_KEY", "fEkXWR4CINttqCQVAQejX5cXgQKrVbnW");

            string _CutX              = INIOperation.ReadValue("config.ini", "CutScreenShot", "StartX", "80");
            string _CutY              = INIOperation.ReadValue("config.ini", "CutScreenShot", "StartY", "270");
            string _CutWidth          = INIOperation.ReadValue("config.ini", "CutScreenShot", "Width", "900");
            string _CutHeight         = INIOperation.ReadValue("config.ini", "CutScreenShot", "Heigh", "980");
            string _UseEmulator       = INIOperation.ReadValue("config.ini", "CutScreenShot", "UseEmulator", Boolean.FalseString);
            string _RemoveUselessInfo = INIOperation.ReadValue("config.ini", "Other", "RemoveUselessInfo", Boolean.TrueString);

            Int32.TryParse(_CutX, out int temp);
            CutX = temp;
            Int32.TryParse(_CutY, out temp);
            CutY = temp;
            Int32.TryParse(_CutWidth, out temp);
            CutWidth = temp;
            Int32.TryParse(_CutHeight, out temp);
            CutHeight = temp;

            Boolean.TryParse(_UseEmulator, out bool _ue);
            UseEmulator = _ue;
            Boolean.TryParse(_RemoveUselessInfo, out bool _rul);
            RemoveUselessInfo = _rul;
        }
Exemple #2
0
        public static void SaveConfig()
        {
            INIOperation.WriteValue("config.ini", "BaiDuOCR", "API_KEY", OCR_API_KEY);
            INIOperation.WriteValue("config.ini", "BaiDuOCR", "SECRET_KEY", OCR_SECRET_KEY);

            INIOperation.WriteValue("config.ini", "CutScreenShot", "StartX", CutX.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "StartY", CutY.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "Width", CutWidth.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "Heigh", CutHeight.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "UseEmulator", UseEmulator.ToString());
        }
Exemple #3
0
        public static void SaveConfig()
        {
            INIOperation.WriteValue("config.ini", "BaiDuOCR", "API_KEY", OCR_API_KEY);
            INIOperation.WriteValue("config.ini", "BaiDuOCR", "SECRET_KEY", OCR_SECRET_KEY);

            INIOperation.WriteValue("config.ini", "CutScreenShot", "StartX", CutX.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "StartY", CutY.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "Width", CutWidth.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "Heigh", CutHeight.ToString());
            INIOperation.WriteValue("config.ini", "CutScreenShot", "UseEmulator", UseEmulator.ToString());
            INIOperation.WriteValue("config.ini", "Other", "RemoveUselessInfo", RemoveUselessInfo.ToString());
            INIOperation.WriteValue("config.ini", "Other", "ShowABC", ShowABC.ToString());
            INIOperation.WriteValue("config.ini", "Other", "UseSoGou", UseSoGou.ToString());

            INIOperation.WriteValue("config.ini", "Other", "HighLightMode", ((int)HighlightMode).ToString());
        }
Exemple #4
0
        public static void LoadConfig()
        {
            OCR_API_KEY    = INIOperation.ReadValue("config.ini", "BaiDuOCR", "API_KEY", "0kEPZddCBO5cUD0Lf1yTN91O");
            OCR_SECRET_KEY = INIOperation.ReadValue("config.ini", "BaiDuOCR", "SECRET_KEY", "fEkXWR4CINttqCQVAQejX5cXgQKrVbnW");

            string _CutX              = INIOperation.ReadValue("config.ini", "CutScreenShot", "StartX", "80");
            string _CutY              = INIOperation.ReadValue("config.ini", "CutScreenShot", "StartY", "270");
            string _CutWidth          = INIOperation.ReadValue("config.ini", "CutScreenShot", "Width", "900");
            string _CutHeight         = INIOperation.ReadValue("config.ini", "CutScreenShot", "Heigh", "980");
            string _UseEmulator       = INIOperation.ReadValue("config.ini", "CutScreenShot", "UseEmulator", Boolean.FalseString);
            string _RemoveUselessInfo = INIOperation.ReadValue("config.ini", "Other", "RemoveUselessInfo", Boolean.TrueString);
            string _ShowABC           = INIOperation.ReadValue("config.ini", "Other", "ShowABC", Boolean.TrueString);
            string _UseSoGou          = INIOperation.ReadValue("config.ini", "Other", "UseSoGou", Boolean.FalseString);
            string _OCREnhance        = INIOperation.ReadValue("config.ini", "BaiDuOCR", "Enhance", Boolean.FalseString);

            string _HighlightMode = INIOperation.ReadValue("config.ini", "Other", "HighLightMode", "2");

            Int32.TryParse(_CutX, out int temp);
            CutX = temp;
            Int32.TryParse(_CutY, out temp);
            CutY = temp;
            Int32.TryParse(_CutWidth, out temp);
            CutWidth = temp;
            Int32.TryParse(_CutHeight, out temp);
            CutHeight = temp;

            Boolean.TryParse(_UseEmulator, out bool _ue);
            UseEmulator = _ue;
            Boolean.TryParse(_RemoveUselessInfo, out bool _rul);
            RemoveUselessInfo = _rul;
            Boolean.TryParse(_ShowABC, out bool _sabc);
            ShowABC = _sabc;
            Boolean.TryParse(_UseSoGou, out bool _usg);
            UseSoGou = _usg;
            Boolean.TryParse(_OCREnhance, out bool ehc);
            OCREnhance = ehc;

            Int32.TryParse(_HighlightMode, out int _hlm);
            HighlightMode = (HLMode)_hlm;
        }