private void pictureBox6_Click(object sender, EventArgs e) //AYARLARI KAYDET { Ayarlar ayarlar = new Ayarlar(); ayarlar.smsusername = textBoxnetgsmusername.Text; ayarlar.smspass = textBoxnetgsmpass.Text; ayarlar.smsheader = textBoxnetgsmheader.Text; ayarlar.girissms = richTextBoxgirissms.Text; ayarlar.girdisms = Convert.ToInt32(checkBox1.Checked); ayarlar.bakiyesms = Convert.ToInt32(checkBox2.Checked); ayarlar.bakiyegoster = Convert.ToInt32(checkBox3.Checked); ayarlar.turnikedevrede = Convert.ToInt32(checkBox5.Checked); ayarlar.tekrarkontrol = Convert.ToInt32(checkBox9.Checked); ayarlar.girissaatkontrol = Convert.ToInt32(checkBox10.Checked); ayarlar.smsfirma = comboBoxsmsfirma.SelectedItem.ToString(); ayarlar.seriportturnike = comboBox1.Text; if (serialPortturnike.IsOpen) { serialPortturnike.Close(); } ayarlar.AyarGuncelle(); baslangicdegerlerinial(); // random olarak r adında bir dğeişken tanımladık. Random r = new Random(); //255'e kadar rastgele sayı üretecektir. int a, b, c; a = r.Next(255); b = r.Next(255); c = r.Next(255); label130.BackColor = Color.FromArgb(a, b, c); }
public void baslangicdegerlerinial() { button6.Enabled = true; button15.Enabled = false; checkBox5.Checked = true; anabilgitb = new TextBox[] { textBoxogrencinumarasikaydet, textBoxogrno, textBoxogradi, textBoxogrsoyad, textBoxogrsinif, textBoxogrsube, textBoxogrdurum }; try { Ayarlar ayarlar = new Ayarlar(); ayarlar.AyarGetir(); textBoxnetgsmusername.Text = ayarlar.smsusername; textBoxnetgsmpass.Text = ayarlar.smspass; textBoxnetgsmheader.Text = ayarlar.smsheader; richTextBoxgirissms.Text = ayarlar.girissms; checkBox1.Checked = Convert.ToBoolean(ayarlar.girdisms); checkBox2.Checked = Convert.ToBoolean(ayarlar.bakiyesms); checkBox3.Checked = Convert.ToBoolean(ayarlar.bakiyegoster); checkBox5.Checked = Convert.ToBoolean(ayarlar.turnikedevrede); checkBox9.Checked = Convert.ToBoolean(ayarlar.tekrarkontrol); checkBox10.Checked = Convert.ToBoolean(ayarlar.girissaatkontrol); comboBoxsmsfirma.Text = ayarlar.smsfirma; comboBox1.Text = ayarlar.seriportturnike; serialPortturnike.PortName = ayarlar.seriportturnike; } catch (Exception ex) { Helper.DosyayaYaz(ex.ToString()); } try { if (serialPortturnike.IsOpen) { serialPortturnike.Close(); } serialPortturnike.Open(); } catch (Exception e) { MessageBox.Show("Seri Port Bağlantısı Açılamadı."); } }