public static string IniReadValue(string Section, string Key) { StringBuilder stringBuilder = new StringBuilder(500); int privateProfileString = DealINI.GetPrivateProfileString(Section, Key, "", stringBuilder, 500, _inipath); return(stringBuilder.ToString()); }
private void btn_register_Click(object sender, EventArgs e) { if (tbx_md5code.Text.Trim() == "") { MessageBox.Show("product key can't be empty!"); return; } if (MD5Handler.verifyMd5Hash(tbx_md5code.Text)) { m_bLicensed = true; DealINI.IniWriteValue("SETTING", "LICENSE", tbx_md5code.Text); groupBox1.Visible = !m_bLicensed; label3.Visible = m_bLicensed; MainDesk._licensedPorduct = true; } else { MessageBox.Show("product key is not correct!"); } }
private void ReadIni() { _license = DealINI.IniReadValue("SETTING", "LICENSE"); _server = DealINI.IniReadValue("SETTING", "SERVER"); }
//public DealINI(string INIPath) //{ // this.inipath = INIPath; //} //public DealINI() //{ // this.inipath = ""; //} public static void IniWriteValue(string Section, string Key, string Value) { DealINI.WritePrivateProfileString(Section, Key, Value, _inipath); }