Exemple #1
0
        public void loadConf()
        {
            try
            {
                List <string> lines = new List <string>();

                foreach (string line in FileTools.readAllLines(getConfFile(), StringTools.ENCODING_SJIS))
                {
                    if (line != "" && line[0] != ';')
                    {
                        lines.Add(line);
                    }
                }

                int c = 0;

                if (int.Parse(lines[c++]) != lines.Count)
                {
                    throw new Exception("Bad item count");
                }

                // items >

                consoleWinStyle    = (ProcessTools.WindowStyle_e) int.Parse(lines[c++]);
                passphraseSuffix   = lines[c++];
                screen_w_min       = IntTools.toInt(lines[c++], 1);
                screen_h_min       = IntTools.toInt(lines[c++], 1);
                screen_w_max       = IntTools.toInt(lines[c++], screen_w_min);
                screen_h_max       = IntTools.toInt(lines[c++], screen_h_min);
                serverInfoCountMax = IntTools.toInt(lines[c++], 1);
                clearLogCycle      = long.Parse(lines[c++]);

                // < items
            }
            catch (Exception e)
            {
                Utils.WriteLog(e);
            }
        }
Exemple #2
0
        // < conf items

        public void loadConf()
        {
            try
            {
                List <string> lines = new List <string>();

                foreach (string line in FileTools.readAllLines(getConfFile(), StringTools.ENCODING_SJIS))
                {
                    if (line != "" && line[0] != ';')
                    {
                        lines.Add(line);
                    }
                }

                int c = 0;

                if (int.Parse(lines[c++]) != lines.Count)
                {
                    throw new Exception("Bad item count");
                }

                // conf items >

                consoleWinStyle          = (ProcessTools.WindowStyle_e) int.Parse(lines[c++]);
                passphraseSuffix         = lines[c++];
                disconnectAndShiftKeysUp = StringTools.toFlag(lines[c++]);
                clearLogCycle            = long.Parse(lines[c++]);
                antiScreenSaver          = StringTools.toFlag(lines[c++]);

                // < conf items
            }
            catch (Exception e)
            {
                Utils.WriteLog(e);
            }
        }