static private void LoadAllInit() { m_path = "c:\\dev"; stLib_CS.File.Ini tIni = new stLib_CS.File.Ini(System.IO.Directory.GetCurrentDirectory() + "\\config.ini"); if (!tIni.Exist()) { System.Console.WriteLine("ini文件不存在,请创建。"); System.Console.ReadKey(); return; } m_port = tIni.ReadValue("net", "port"); m_maxBackLog = Convert.ToInt32(tIni.ReadValue("net", "maxbacklog")); }
private void LoadAllInit() { stLib_CS.File.Ini tIni = new stLib_CS.File.Ini(System.IO.Directory.GetCurrentDirectory() + "\\config.ini"); if (!tIni.Exist()) { MessageBox.Show("ini文件不存在,请创建。"); this.Close(); return; } string strCount = tIni.ReadValue("res", "totalcount"); for (int i = 0; i < Convert.ToInt32(strCount); i++) { HHI_ServerInfo info = new HHI_ServerInfo(); info.Port = tIni.ReadValue(i.ToString(), "port"); info.IP = tIni.ReadValue(i.ToString(), "ip"); info.Name = tIni.ReadValue(i.ToString(), "name"); info.ID = i; m_serveinfos.Add(info); } }