帮帮我呀!!  在线急等

xunjie 2003-07-27 06:50:33
用C#写一个简单的登录验证程序,只验证用户名和密码
...全文
29 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
xunjie 2003-07-27
  • 打赏
  • 举报
回复
能给我一点文字说明吗?
数据库连接后面的
雪狼1234567 2003-07-27
  • 打赏
  • 举报
回复
System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection("server=localhost;database=northWind;uid=sa;password=110");
conn.Open();
System.Data.SqlClient.SqlDataAdapter da = new System.Data.SqlClient.SqlDataAdapter("select name,prd from password",conn);
dt = new System.Data.DataSet();
da.Fill(dt,"password");
if ((this.tx.Text == dt.Tables[0].rows[0][0]) && (this.tx.Text == dt.Tables[0].rows[0][1]))
{
MessageBox.Show("right");
}
else
{
MessageBox.Show("Erro ");
}

111,096

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧