void 账户ToolStripMenuItemClick(object sender, EventArgs e) { string Current; Current = Directory.GetCurrentDirectory();//获取当前根目录 iniFile ini=new iniFile(Current+"/config.ini"); ArrayList list=ini.ReadSections(); if(list.Count==0) { frmAccount firstAccount=new frmAccount(); firstAccount.firstAccount="yes"; firstAccount.Show(); } else { frmAccount firstAccount=new frmAccount(); firstAccount.firstAccount="no"; firstAccount.Show(); } // string stemp=ini.ReadValue("Account","AccountName"); // if(string.IsNullOrEmpty(stemp)) // { // frmAccount firstAccount=new frmAccount(); // firstAccount.firstAccount="yes"; // firstAccount.Show(); //// addAccount.panel1.Visible=false; // //// frmAccount firstAccount=new frmAccount(); //// firstAccount.Show(); //// firstAccount. //// firstAccount.paa //// addAccount.Show(); //// addAccount.panel1.Visible=false; //// addAccount.label6.Visible=true; //// addAccount.txtAccountName.Visible=true; // } // else // { // frmAccount firstAccount=new frmAccount(); //// firstAccount.firstAccount="yes"; // firstAccount.Show(); // } }
public void LoadIniFile() { string Current; Current = Directory.GetCurrentDirectory();//获取当前根目录 // 写入ini iniFile ini=new iniFile(Current+"/config.ini"); // ini.WriteValue("Setting","key1","hello word!"); // ini.WriteValue("Setting","key2","hello ini!"); // ini.WriteValue("SettingImg", "Path", "IMG.Path"); // 读取ini // string stemp = ini.ReadValue("Setting","key2"); // lbAccount.Items.Add(stemp); ArrayList list=ini.ReadSections(); foreach(object o in list) { lbAccount.Items.Add(o.ToString()); } if(lbAccount.Items.Count!=0) { lbAccount.SelectedIndex=0; } }