LOGUIN EN C# CON SQLSERVER
CODIGO PARA EL PRIMER CAPITULO DEL VIDEO
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.Runtime.InteropServices;
namespace LOGIN01
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
[DllImport("user32.DLL", EntryPoint = "ReleaseCapture")]
private extern static void ReleaseCapture();
[DllImport("user32.DLL", EntryPoint = "SendMessage")]
private extern static void SendMessage(System.IntPtr hWnd, int wMsg, int wParam, int lParam);
private void Form1_Load(object sender, EventArgs e)
{
}
private void Panel1_MouseMove(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, 0x112, 0xf012, 0);
}
private void PictureBox1_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}
AQUÍ LES DEJO LA IMAGEN UTILIZADA
COLORES UTILIZADOS PARA LA PRIMERA PARTE
COLOR ROZADO :: >>>>>>> 185; 33; 96
COLOR DE LOS TEXTBOX:: >>>>>>>> 42; 55; 71
PARA LOS BORDES Y PROGRESS BAR CIRCULAR
utilizaremos la librería bunifu en un vídeo en el canal de SOLUCIONES TECNOLÓGICAS indico como implementar esta librería en nuestro visual estudio
LA SEGUNDA PARTE
REALIZAREMOS LA CONEXIÓN CON LA BASE DE DATOS
agregaremos una nueva clase en nuestro proyecto para la conexion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
namespace LOGIN01
{
class Conexion
{
public static SqlConnection Conectar()
{
SqlConnection cn = new SqlConnection("SERVER=GLOBALSACK;DATABASE=LOGIN01;integrated security=true;");
cn.Open();
return cn;
}
}
}
LISTO AHORA REALIZAREMOS LA VALIDACIÓN DEL USUARIO Y PASSWORDS
el siguiente código ira en el boton INGRESAR
private void Button1_Click(object sender, EventArgs e)
{
Conexion.Conectar();
SqlDataAdapter da = new SqlDataAdapter("SELECT COUNT(*) FROM USUARIOS WHERE USERS='" + textBox1.Text + "' AND PASSWORDS ='" + textBox2.Text + "'", Conexion.Conectar());
DataTable dt = new DataTable();
da.Fill(dt);
if(dt.Rows [0][0].ToString()=="1")
{
this.Hide();
new Form2().Show();
}
else
{
MessageBox.Show("Acceso Denegado");
}
}
LISTO TODOS LOS VÍDEOS EN EL CANAL DE SOLUCIONES TECNOLÓGICAS