Example #1
0
        public void LoadData()
        {
            try
            {
                string[] lines = File.ReadAllLines("WHTT.dat", Tools.ENCODING_SJIS);
                int      c     = 0;

                // ---- data ----

                this.PortNo          = Tools.ToRange(int.Parse(lines[c++]), 1, 65535);
                this.ShowConsoleMode = (ShowConsoleMode_e)Tools.ToRange(int.Parse(lines[c++]), 0, 2);
                this.MainWin_L       = int.Parse(lines[c++]);
                this.MainWin_T       = int.Parse(lines[c++]);
                this.KeepWinPosFlag  = int.Parse(lines[c++]) != 0;

                // ----

                File.Delete("WHTT.exe.dat");                 // old ver
            }
            catch
            { }

            this.DomainInfoList.Clear();

            try
            {
                string[] lines = File.ReadAllLines("DocRoot.dat", Tools.ENCODING_SJIS);

                foreach (string line in lines)
                {
                    int sp = line.IndexOf(' ');

                    DomainInfo di = new DomainInfo()
                    {
                        Domain  = line.Substring(0, sp),
                        RootDir = line.Substring(sp + 1),
                    };

                    if (di.Domain == "")
                    {
                        di.Domain = "default";
                    }

                    if (di.RootDir == "")
                    {
                        di.RootDir = ".";
                    }

                    this.DomainInfoList.Add(di);
                }
            }
            catch
            { }
        }
Example #2
0
        public ShowConsoleMode_e ShowConsoleMode = ShowConsoleMode_e.HIDE;         // 隠しモード

        public void LoadConfig()
        {
            this.PortNo = DEFAULT_PORTNO;

            try
            {
                string[] lines = File.ReadAllLines(this.DAT_FILE, Tools.ENCODING_SJIS);
                int      c     = 0;

                // ---- load data ----

                this.PortNo          = (int)Tools.ParseLong(lines[c++], 1, 65535, Gnd.I.DEFAULT_PORTNO);
                this.ShowConsoleMode = (ShowConsoleMode_e)Tools.ParseLong(lines[c++], 0, 2, 0);

                // ----
            }
            catch
            { }
        }