Виктор Зиборов. Visual C#2010 На примерах-Санкт-Петербург”БХБ-ПЕТЕРБУРГ”2011
https://www.coursehero.com
https://it-black.ru/rabota-s-bazoj-dannyh-v-ci_sharp
Ilovalar
Login va parolni o`zgartirish
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace Rajabov_Jamshid_kurs_ishi
{
public partial class login_parol_o_zgartirish : Form
{
public login_parol_o_zgartirish()
{
InitializeComponent();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true) { textBox2.UseSystemPasswordChar = false; } else textBox2.UseSystemPasswordChar = true;
}
private void login_parol_o_zgartirish_Load(object sender, EventArgs e)
{
// TODO: данная строка кода позволяет загрузить данные в таблицу "parolDataSet.login_parol". При необходимости она может быть перемещена или удалена.
this.login_parolTableAdapter.Fill(this.parolDataSet.login_parol);
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader uqish_login = new StreamReader(@"\Rajabov Jamshid kurs ishi\Rajabov Jamshid kurs ishi\bin\Debug\login.txt");
StreamReader uqish_parol = new StreamReader(@"\Rajabov Jamshid kurs ishi\Rajabov Jamshid kurs ishi\bin\Debug\parol.txt");
if ((textBox1.Text == "") || (textBox2.Text == ""))
MessageBox.Show("Malumot to`liq kiritilmadi");
else
if ((uqish_login.ReadLine() == textBox1.Text) &&
(uqish_parol.ReadLine() == textBox2.Text))
{
textBox1.Text = ""; textBox2.Text = "";
button2.Visible = true;
label1.Text = "Yangi Loginni kiriting";
label2.Text = "Yangi Parolni kiriting";
}
else MessageBox.Show("Login yoki Parol notog`ri kiritildi");
uqish_login.Close();
uqish_parol.Close();
}
private void button2_Click(object sender, EventArgs e)
{
StreamWriter yozish_login = new StreamWriter(@"\Rajabov Jamshid kurs ishi\Rajabov Jamshid kurs ishi\bin\Debug\login.txt");
StreamWriter yozish_parol = new StreamWriter(@"\Rajabov Jamshid kurs ishi\Rajabov Jamshid kurs ishi\bin\Debug\parol.txt");
if ((textBox1.Text == "") || (textBox2.Text == ""))
MessageBox.Show("Malumot to`liq kiritilmadi");
else
{
yozish_login.WriteLine( textBox1.Text);
yozish_parol.WriteLine( textBox2.Text);
textBox1.Text = ""; textBox2.Text = "";
label1.Text = "Oldingi loginni kiriting:";
label2.Text = "Oldingi parolni kiriting:";
button2.Visible = false;
Close();
}
yozish_parol.Close();
yozish_login.Close();
}
}
}
Dostları ilə paylaş: |