| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 644 人关注过本帖
标题:C#修改密码代码
只看楼主 加入收藏
qq734885940
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-4-9
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
C#修改密码代码
if (textBox1.Text == ""||textBox2.Text == ""||textBox3.Text == "")             {                 if (MessageBox.Show("      您输入的信息不完整!     ,是否关闭窗口", "提示",                           MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==                           DialogResult.Yes)                 {                     this.Close();                                     }             }             else  if(textBox2.Text!=textBox3.Text)             {                 if (MessageBox.Show("     您的新密码输入错误!     ,是否关闭窗口", "提示",                           MessageBoxButtons.YesNo, MessageBoxIcon.Question) ==                           DialogResult.Yes)                 {                     this.Close();                                     }             }             else if (textBox1.Text != "")             {                 string constr = "integrated security=SSPI;data source=.;persist security info=False;initial catalog=anne";                 SqlConnection sqlConnection1 = new SqlConnection(constr);                 string sq1 = "select 密码 from 密码表 where 用户名='admin'";                 SqlDataAdapter sqlDataAdapter1 = new SqlDataAdapter(sq1, sqlConnection1);                 DataSet dt1 = new DataSet();                 sqlDataAdapter1.Fill(dt1, "密码表");                 string sq2= textBox1.Text;                 string sq3 = (string)dt1.Tables["密码表"].Rows[0]["密码"];                 if (sq2.Equals(sq3.Trim()) && textBox2.Text == textBox3.Text)                 {                     string constr1 = "integrated security=SSPI;data source=.;persist security info=False;initial catalog=anne";                     string sq4 = "update 密码表 set 密码='" + textBox2.Text + "' where 密码='" + textBox1.Text + "'";                     SqlConnection sqlConnection = new SqlConnection(constr1);                     sqlConnection.Open();                     SqlCommand cd = new SqlCommand(sq4, sqlConnection);                     SqlDataReader sr = cd.ExecuteReader();                     MessageBox.Show("    密码已修改成功    ", "提  醒");
搜索更多相关主题的帖子: 修改密码 信息 
2013-04-12 09:02
elongtown
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:12
帖 子:138
专家分:1003
注 册:2013-2-18
收藏
得分:10 
问题是什么
2013-04-14 14:34
party620
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:18
帖 子:696
专家分:2521
注 册:2013-1-31
收藏
得分:10 
重新排版一下
2013-04-15 09:29
快速回复:C#修改密码代码
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035177 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved