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 aksamci.dev
{
public partial class Form1 : Form
{
bool tutus;
int FareX, FareY;
public Form1()
{
InitializeComponent();
}
SqlConnection baglan=new SqlConnection(@"Data Source=DESKTOP-BIEPS4S;Initial Catalog=aksamcidev;Integrated Security=True");
private void guna2ImageButton1_Click(object sender, EventArgs e)
{
this.Close();
}
private void guna2ImageButton4_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("
Login • Instagram");
}
private void guna2Panel1_MouseDown(object sender, MouseEventArgs e)
{
tutus = true;
FareX = Cursor.Position.X - this.Left;
FareY = Cursor.Position.Y - this.Top;
}
private void guna2Panel1_MouseMove(object sender, MouseEventArgs e)
{
if (tutus == true)
{
this.Left = Cursor.Position.X - FareX;
this.Top = Cursor.Position.Y - FareY;
}
}
private void guna2TextBox2_TextChanged(object sender, EventArgs e)
{
}
private void guna2TextBox2_Enter(object sender, EventArgs e)
{
if (guna2TextBox2.Text == "Kullanıcı Adı")
{
guna2TextBox2.Text = "";
guna2TextBox2.ForeColor = Color.Gray;
}
}
private void guna2TextBox2_Leave(object sender, EventArgs e)
{
if (guna2TextBox2.Text == "")
{
guna2TextBox2.Text = "Kullanıcı Adı";
guna2TextBox2.ForeColor = Color.Gray;
}
}
private void guna2TextBox1_Enter(object sender, EventArgs e)
{
if (guna2TextBox1.Text == "Şifre")
{
guna2TextBox1.Text = "";
guna2TextBox1.ForeColor = Color.Gray;
}
}
private void guna2TextBox1_Leave(object sender, EventArgs e)
{
if (guna2TextBox1.Text == "")
{
guna2TextBox1.Text = "Şifre";
guna2TextBox1.ForeColor = Color.Gray;
}
}
private void guna2PictureBox1_Click(object sender, EventArgs e)
{
}
private void guna2Panel1_Paint(object sender, PaintEventArgs e)
{
}
private void guna2Button1_Click(object sender, EventArgs e)
{
if (guna2TextBox2.Text == "" || guna2TextBox1.Text == "")
{
MessageBox.Show("Lütfen tüm alanları doldurunuz!");
}
else
{
baglan.Open();
SqlCommand cmd = new SqlCommand("Select * from aksamcidev where ADSOYAD=@P2 AND ŞİFRE=@P1, baglan");
cmd.Parameters.AddWithValue("@P2", guna2TextBox2.Text);
cmd.Parameters.AddWithValue("@P1", guna2TextBox1.Text);
SqlDataReader dr = cmd.ExecuteReader();
if(dr.Read())
{
Form2 frm=new Form2();
frm.Show();
this.Hide();
baglan.Close();
}
else
{
MessageBox.Show("Lütfem Bilgilerinizi Kontrol Ediniz.");
}
}
}
private void guna2Panel1_MouseUp(object sender, MouseEventArgs e)
{
tutus = false;
FareX = 0;
FareY = 0;
}
}
}