private void Form1_Load(object sender, EventArgs e) { flowLayoutPanel1.Visible = false; configedit cfg = new configedit(); cfg.ReadAllSettings(); if (cfg.tuscias == true) { MessageBox.Show("Programos nustatymų failas tuščias. \nReikalingi papildomi nustatymai."); paruosimas init = new paruosimas(); init.ShowDialog(); } else { prisijungimas login = new prisijungimas(); if (login.ShowDialog() == DialogResult.OK) { Text = lango_pavadinimas + " Prisijungęs: " + prisijungimas.naudotojas; if (prisijungimas.naudotojas == "admin") { flowLayoutPanel1.Visible = true; } if (prisijungimas.naudotojas == "user") { flowLayoutPanel1.Visible = true; btn_parametrai.Visible = false; } } } }
private void button2_Click(object sender, EventArgs e) { configedit cfg = new configedit(); //cfg.AddUpdateAppSettings("Testas", "Rakto \"Testas\" reiksme"); //cfg.ReadAppSetting("Testas"); cfg.ReadAllSettings(); }
private void button1_Click(object sender, EventArgs e) { //hostname = textBox_hostname.Text; try { setHostname(textBox_hostname.Text); uid = textBox_uid.Text; password = textBox_password.Text; configedit cfg = new configedit(); cfg.AddUpdateAppSettings("aledashopadmin", "Server=" + getHostname() + ";User Id=" + uid + ";Password="******";"); MessageBox.Show("Nustatymų failas sukurtas."); } catch (Exception ex) { MessageBox.Show(ex.Message); } MysqlCommands cmd = new MysqlCommands(); //cmd.createDB(); }