精品文档,仅供学****与交流,如有侵权请联系网站删除
【精品文档】第 1 页
using System;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
namespace AC
public partial class Form1 : Form
public Form1()
InitializeComponent();
private void button1_Click(object sender, EventArgs e)
string uname = ();
string upassword = ();
SqlConnection thisconnection = new SqlConnection(@"Server=SQL连接名;Integrated Security=True;" + "DataBase=数据库名");
();
SqlCommand thiscommand = ();
= "select ID,PS from 表名 where ID='" + uname + " '";
SqlDataReader thisreader = ();
if (())
if (thisreader["PS"].ToString().Trim() == upassword)
("恭喜您登陆成功!", "登陆成功!", , );
//yhxx tt = new yhxx();
//();
//();//关闭当前窗体
//new Form1().Hide();
C#登录窗口代码-有图 来自淘豆网www.taodocs.com转载请标明出处.