Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace WindowsFormsApp3
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- SqlConnection con = new SqlConnection(@"Data Source=87.254.161.7,1433;Initial Catalog=MuOnline;User ID=sa;Password=123456");
- SqlDataAdapter sda = new SqlDataAdapter("SELECT Rank FROM Admins WHERE Username='"+ textBox1.Text +"' and Password='"+ textBox2.Text +"'",con);
- DataTable dt = new System.Data.DataTable();
- sda.Fill(dt);
- if(dt.Rows.Count == 1)
- {
- this.Hide();
- Main ss = new Main(dt.Rows[0][0].ToString());
- ss.Show();
- }
- else
- {
- MessageBox.Show("Please Check your username or password");
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- this.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement