کدتون رو اینجا میذاشتین
(private void btnvorood_Click(object sender, EventArgs e
}
(""==if (tbxusername .Text
}
; ("لطفا نام کاربری خود را وارد کنید") MessageBox.Show
();tbxusername.Focus
{
( ""== else if (tbxpass .Text
}
; ("لطفا رمز خود را وارد کنید") MessageBox.Show
(); tbxpass.Focus
{
( "" == else if (tbxtyp.Text
}
MessageBox.Show("لطفا نوع کاربری خود را وارد کنید");
; () tbxtyp.Focus
{
else
}
; () SqlConnection myconnect = new SqlConnection
myconnect.ConnectionString = @"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\nylon sepid.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True ";e
;() SqlCommand command = new SqlCommand
command.CommandText = "select * from user where username='"+tbxusername .Text +"' pass='"+tbxpass .Text +"' typeuser='"+tbxtyp.Text+"';t
; command.Connection = myconnect
;()myconnect.Open
;()SqlDataReader reader = command.ExecuteReader
( () if (!reader.Read
}
MessageBox.Show("شما کاربر سیستم نیستید");
;""=tbxusername.Text
;""= tbxpass.Text
;""= tbxtyp.Text
{
else
}
;()Form2 f = new Form2
;(f.label3.Text = reader.GetString(5
;()f.Show
;this.Visible = false
{
;()reader.Close
;()myconnect.Close
{
{
توسط
یونس ابراهیمی
(6,480 امتیاز)
●6 ●17 ●129