Exemplo n.º 1
0
        public static void Read()
        {
            string path = Application.ExecutablePath;
            path = path.Substring(0, path.LastIndexOf(@"\"));

            if (!File.Exists(path + @"\\Config.ini")) throw new Exception("Config.ini not exist");
            INIHelper file = new INIHelper(path + @"\\Config.ini");

            GET_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "GET_STOCK_DATA_EXE"));
            GET_TBILL_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "GET_TBILL_DATA_EXE"));
            CLUSTER_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "CLUSTER_STOCK_DATA_EXE"));
            CATEGORIZE_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "CATEGORIZE_STOCK_DATA_EXE"));
            FILTER_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "FILTER_STOCK_DATA_EXE"));
            TIMING_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "TIMING_STOCK_DATA_EXE"));
            COMPILE_STOCK_DATA_EXE = FormatPath(file.IniReadValue("PROGRAM", "COMPILE_STOCK_DATA_EXE"));
            OPTIMIZE_PORTFOLIO_EXE = FormatPath(file.IniReadValue("PROGRAM", "OPTIMIZE_PORTFOLIO_EXE"));

            ENVIRONMENT_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "ENVIRONMENT_PATH_DEFAULT"));
            DATA_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "DATA_PATH_DEFAULT"));
            CLUSTER_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "CLUSTER_PATH_DEFAULT"));
            STOCK_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "STOCK_PATH_DEFAULT"));
            GENUS_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "GENUS_PATH_DEFAULT"));
            INDEX_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "INDEX_PATH_DEFAULT"));
            TBILL_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "TBILL_PATH_DEFAULT"));
            STAT_PATH_DEFAULT = FormatPath(file.IniReadValue("ENVIRONMENT", "STAT_PATH_DEFAULT"));

            EXPORT_PATH_DEFAULT = FormatPath(file.IniReadValue("SAVING", "EXPORT_PATH_DEFAULT"));
            LOG_PATH_DEFAULT = FormatPath(file.IniReadValue("SAVING", "LOG_PATH_DEFAULT"));
            AUTO_PATH_DEFAULT = EXPORT_PATH_DEFAULT + @"\Auto";
        }
Exemplo n.º 2
0
        public static void Write()
        {
            string path = Application.ExecutablePath;
            path = path.Substring(0, path.LastIndexOf(@"\"));
            INIHelper file = new INIHelper(path + @"\\Config.ini");

            file.IniWriteValue("PROGRAM", "GET_STOCK_DATA_EXE", GET_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "GET_TBILL_DATA_EXE", GET_TBILL_DATA_EXE);
            file.IniWriteValue("PROGRAM", "CLUSTER_STOCK_DATA_EXE", CLUSTER_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "CATEGORIZE_STOCK_DATA_EXE", CATEGORIZE_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "FILTER_STOCK_DATA_EXE", FILTER_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "TIMING_STOCK_DATA_EXE", TIMING_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "COMPILE_STOCK_DATA_EXE", COMPILE_STOCK_DATA_EXE);
            file.IniWriteValue("PROGRAM", "OPTIMIZE_PORTFOLIO_EXE", OPTIMIZE_PORTFOLIO_EXE);

            file.IniWriteValue("ENVIRONMENT", "ENVIRONMENT_PATH_DEFAULT", ENVIRONMENT_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "DATA_PATH_DEFAULT", DATA_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "CLUSTER_PATH_DEFAULT", CLUSTER_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "STOCK_PATH_DEFAULT", STOCK_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "GENUS_PATH_DEFAULT", GENUS_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "INDEX_PATH_DEFAULT", INDEX_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "TBILL_PATH_DEFAULT", TBILL_PATH_DEFAULT);
            file.IniWriteValue("ENVIRONMENT", "STAT_PATH_DEFAULT", STAT_PATH_DEFAULT);

            file.IniWriteValue("SAVING", "EXPORT_PATH_DEFAULT", EXPORT_PATH_DEFAULT);
            file.IniWriteValue("SAVING", "LOG_PATH_DEFAULT", LOG_PATH_DEFAULT);
        }