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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string sqlstring = "Data Source=zhs31;Initial Catalog=database;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False;";
SqlConnection a = new SqlConnection(sqlstring); a.Open();
SqlCommand b = new SqlCommand("select * from [登陆]", a);
SqlDataReader c = b.ExecuteReader(); while (c.Read())
{
if (this.textBox1.Text.Equals(c["user"].ToString()) && this.textBox2.Text.Equals(c["password"].ToString()))
{ MessageBox.Show("cuowu"); }
// else
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余1页未读,立即下载