コード例 #1
0
        public static void WriteConfig()
        {
            IniControl.WriteBoolValue("AIOBOT", "AutoLogin", g_bAIOBOT_AutoLogin, g_strConfigPath);
            IniControl.WriteStringValue("AIOBOT", "Email", g_strAIOBOT_Email, g_strConfigPath);
            IniControl.WriteStringValue("AIOBOT", "Password", g_strAIOBOT_Password, g_strConfigPath);

            IniControl.WriteBoolValue("Site", "AutoLogin", g_bSite_AutoLogin, g_strConfigPath);
            IniControl.WriteStringValue("Site", "LoginID", g_strSiteLoginID, g_strConfigPath);
            IniControl.WriteStringValue("Site", "Password", g_strSiteLoginPass, g_strConfigPath);

            IniControl.WriteIntValue("Setting", "RetryInterval", g_nRetryInterval, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "RetryCount", g_nRetryCount, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "OrderSleepTime", g_nOrderSleepTime, g_strConfigPath);
            IniControl.WriteBoolValue("Setting", "UseProxy", g_bUseProxy, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "ProxyIP", g_strProxyIP, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "ProxyID", g_strProxyID, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "ProxyPass", g_strProxyPass, g_strConfigPath);
            IniControl.WriteBoolValue("Setting", "UseTrayIcon", g_bUseTrayIcon, g_strConfigPath);
            IniControl.WriteBoolValue("Setting", "UseStartTime", g_bUseStartTime, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "StartDay", g_strStartDay, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "StartTime", g_strStartTime, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "AutoGoodID", g_strAutoGoodID, g_strConfigPath, true);
            IniControl.WriteStringValue("Setting", "AutoSize1", g_strAutoSize1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "AutoSize2", g_strAutoSize2, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "AutoSize3", g_strAutoSize3, g_strConfigPath);
            IniControl.WriteBoolValue("Setting", "UseNoSizeOrder", g_bUseNoSizeOrder, g_strConfigPath);
            IniControl.WriteBoolValue("Setting", "UseAlarm", g_bUseAlarm, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "BeforeStart", g_nBeforeStart, g_strConfigPath);

            IniControl.WriteBoolValue("Setting", "UseSearch", g_bUseSearch, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "SearchInterval", g_nSearchInterval, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "SearchURLCount", g_strSearchURL.Count, g_strConfigPath);
            for (int i = 1; i <= g_strSearchURL.Count; i++)
            {
                IniControl.WriteStringValue("Setting", "SearchURL" + i.ToString(), g_strSearchURL[i - 1], g_strConfigPath, true);
            }
            IniControl.WriteIntValue("Setting", "SearchKeywordCount", g_strSearchKeyword.Count, g_strConfigPath);
            for (int i = 1; i <= g_strSearchKeyword.Count; i++)
            {
                IniControl.WriteStringValue("Setting", "SearchKeyword" + i.ToString(), g_strSearchKeyword[i - 1], g_strConfigPath, true);
            }
            IniControl.WriteBoolValue("Setting", "UseRealOrder", g_bUseRealOrder, g_strConfigPath);

            IniControl.WriteBoolValue("Setting", "UseLoginInfo", g_bUseLoginInfo, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Name1", g_strName1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Name2", g_strName2, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Huri1", g_strHuri1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Huri2", g_strHuri2, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "PostalCode1", g_strPostalCode1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "PostalCode2", g_strPostalCode2, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "Prefecture", g_nPrefecture, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Address1", g_strAddress1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Address2", g_strAddress2, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Address3", g_strAddress3, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Mobile1", g_strMobile1, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Mobile2", g_strMobile2, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Mobile3", g_strMobile3, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "DeliveryTime", g_strDeliveryTime, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Hope", g_strHope, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "UsePointType", (int)g_nUsePointType, g_strConfigPath);
            IniControl.WriteIntValue("Setting", "PartialPoint", g_nPartialPoint, g_strConfigPath);
        }
コード例 #2
0
        public static void ReadConfig()
        {
            g_strConfigPath = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, CONFIG_FILE_NAME);

            g_bAIOBOT_AutoLogin  = IniControl.GetBoolValue("AIOBOT", "AutoLogin", 0, g_strConfigPath);
            g_strAIOBOT_Email    = IniControl.GetStringValue("AIOBOT", "Email", "", 255, g_strConfigPath);
            g_strAIOBOT_Password = IniControl.GetStringValue("AIOBOT", "Password", "", 255, g_strConfigPath);

            g_bSite_AutoLogin  = IniControl.GetBoolValue("Site", "AutoLogin", 0, g_strConfigPath);
            g_strSiteLoginID   = IniControl.GetStringValue("Site", "LoginID", "", 255, g_strConfigPath);
            g_strSiteLoginPass = IniControl.GetStringValue("Site", "Password", "", 255, g_strConfigPath);

            g_nRetryInterval     = IniControl.GetIntValue("Setting", "RetryInterval", 100, g_strConfigPath);
            g_nRetryCount        = IniControl.GetIntValue("Setting", "RetryCount", 5, g_strConfigPath);
            g_nOrderSleepTime    = IniControl.GetIntValue("Setting", "OrderSleepTime", 10, g_strConfigPath);
            g_bUseProxy          = IniControl.GetBoolValue("Setting", "UseProxy", 0, g_strConfigPath);
            g_strProxyIP         = IniControl.GetStringValue("Setting", "ProxyIP", "", 100, g_strConfigPath);
            g_strProxyID         = IniControl.GetStringValue("Setting", "ProxyID", "", 100, g_strConfigPath);
            g_strProxyPass       = IniControl.GetStringValue("Setting", "ProxyPass", "", 100, g_strConfigPath);
            g_bUseTrayIcon       = IniControl.GetBoolValue("Setting", "UseTrayIcon", 0, g_strConfigPath);
            g_bUseStartTime      = IniControl.GetBoolValue("Setting", "UseStartTime", 0, g_strConfigPath);
            g_strStartDay        = IniControl.GetStringValue("Setting", "StartDay", "", 100, g_strConfigPath);
            g_strStartTime       = IniControl.GetStringValue("Setting", "StartTime", "", 100, g_strConfigPath);
            g_strAutoGoodID      = IniControl.GetStringValue("Setting", "AutoGoodID", "", 100, g_strConfigPath, true);
            g_strAutoSize1       = IniControl.GetStringValue("Setting", "AutoSize1", "", 100, g_strConfigPath);
            g_strAutoSize2       = IniControl.GetStringValue("Setting", "AutoSize2", "", 100, g_strConfigPath);
            g_strAutoSize3       = IniControl.GetStringValue("Setting", "AutoSize3", "", 100, g_strConfigPath);
            g_bUseNoSizeOrder    = IniControl.GetBoolValue("Setting", "UseNoSizeOrder", 1, g_strConfigPath);
            g_bUseAlarm          = IniControl.GetBoolValue("Setting", "UseAlarm", 1, g_strConfigPath);
            g_nBeforeStart       = IniControl.GetIntValue("Setting", "BeforeStart", 30, g_strConfigPath);
            g_nAutoOrderAmount   = IniControl.GetIntValue("Setting", "AutoOrderAmount", 1, g_strConfigPath);
            g_nAutoOrderCount    = IniControl.GetIntValue("Setting", "AutoOrderCount", 1, g_strConfigPath);
            g_bUseAutoOrderPoint = IniControl.GetBoolValue("Setting", "UseAutoOrderPoint", 1, g_strConfigPath);

            g_strToken     = IniControl.GetStringValue("Setting", "Token", "", 100, g_strConfigPath);
            g_strValidity  = IniControl.GetStringValue("Setting", "Validity", "", 100, g_strConfigPath);
            g_strMaskedPan = IniControl.GetStringValue("Setting", "MaskedPan", "", 100, g_strConfigPath);

            g_bUseSearch      = IniControl.GetBoolValue("Setting", "UseSearch", 0, g_strConfigPath);
            g_nSearchInterval = IniControl.GetIntValue("Setting", "SearchInterval", 100, g_strConfigPath);
            int nCount = IniControl.GetIntValue("Setting", "SearchURLCount", 0, g_strConfigPath);

            g_strSearchURL.Clear();
            for (int i = 1; i <= nCount; i++)
            {
                string strURL = IniControl.GetStringValue("Setting", "SearchURL" + i.ToString(), "", 100, g_strConfigPath, true);
                g_strSearchURL.Add(strURL);
            }
            nCount = IniControl.GetIntValue("Setting", "SearchKeywordCount", 0, g_strConfigPath);
            g_strSearchKeyword.Clear();
            for (int i = 1; i <= nCount; i++)
            {
                string strWord = IniControl.GetStringValue("Setting", "SearchKeyword" + i.ToString(), "", 100, g_strConfigPath, true);
                g_strSearchKeyword.Add(strWord);
            }
            g_bUseRealOrder = IniControl.GetBoolValue("Setting", "UseRealOrder", 0, g_strConfigPath);

            g_bUseLoginInfo   = IniControl.GetBoolValue("Setting", "UseLoginInfo", 1, g_strConfigPath);
            g_strName1        = IniControl.GetStringValue("Setting", "Name1", "", 100, g_strConfigPath);
            g_strName2        = IniControl.GetStringValue("Setting", "Name2", "", 100, g_strConfigPath);
            g_strHuri1        = IniControl.GetStringValue("Setting", "Huri1", "", 100, g_strConfigPath);
            g_strHuri2        = IniControl.GetStringValue("Setting", "Huri2", "", 100, g_strConfigPath);
            g_strPostalCode1  = IniControl.GetStringValue("Setting", "PostalCode1", "", 100, g_strConfigPath);
            g_strPostalCode2  = IniControl.GetStringValue("Setting", "PostalCode2", "", 100, g_strConfigPath);
            g_nPrefecture     = IniControl.GetIntValue("Setting", "Prefecture", 0, g_strConfigPath);
            g_strAddress1     = IniControl.GetStringValue("Setting", "Address1", "", 100, g_strConfigPath);
            g_strAddress2     = IniControl.GetStringValue("Setting", "Address2", "", 100, g_strConfigPath);
            g_strAddress3     = IniControl.GetStringValue("Setting", "Address3", "", 100, g_strConfigPath);
            g_strMobile1      = IniControl.GetStringValue("Setting", "Mobile1", "", 100, g_strConfigPath);
            g_strMobile2      = IniControl.GetStringValue("Setting", "Mobile2", "", 100, g_strConfigPath);
            g_strMobile3      = IniControl.GetStringValue("Setting", "Mobile3", "", 100, g_strConfigPath);
            g_strDeliveryTime = IniControl.GetStringValue("Setting", "DeliveryTime", "", 100, g_strConfigPath);
            g_strHope         = IniControl.GetStringValue("Setting", "Hope", "", 100, g_strConfigPath);
            g_nUsePointType   = (UsePointType)IniControl.GetIntValue("Setting", "UsePointType", (int)UsePointType.NoUse, g_strConfigPath);
            g_nPartialPoint   = IniControl.GetIntValue("Setting", "PartialPoint", 0, g_strConfigPath);

            IniControl.WriteStringValue("Setting", "Token", g_strToken, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "Validity", g_strValidity, g_strConfigPath);
            IniControl.WriteStringValue("Setting", "MaskedPan", g_strMaskedPan, g_strConfigPath);
        }