;43 /// <param name="sender"></param>
44 /// <param name="e"></param>
45 private void btnModifyPwd_Click(object sender, System.EventArgs e)
46 {
47 string strUserID = txtLoginID.Text;
48 if( strUserID == String.Empty )
49 {
50 controlMessage.InnerHtml = "用户名不能为空";
51 return;
52 }
53
54 //判断两次密码输入是否相同
55 if( txtNewPassword.Text != txtConfirmPassword.Text )
56 {
57 controlMessage.InnerHtml = "两次输入的密码不一致,请重新输入";
58 return;
59 }
60
61 IniFile ini = new IniFile( _strServUDaemonPath );
62 string strSectionValue = "USER=" + strUserID.Trim() + "|1";
63
64 //通过读取指定用户的HomeDir来确定是否存在该用户
65 if( ini.ReadString( strSectionValue, "HomeDir", "" ) == "" )
66 {
67 controlMessage.InnerHtml = "指定的用户不存在";
68 return;
69 }
70
71 //开始判断密码是否正确
72 string strPassword = ini.ReadString( strSectionValue, "Password", "" );
73
74 string strPasswordFrontTwoChars;
75 &
44 /// <param name="e"></param>
45 private void btnModifyPwd_Click(object sender, System.EventArgs e)
46 {
47 string strUserID = txtLoginID.Text;
48 if( strUserID == String.Empty )
49 {
50 controlMessage.InnerHtml = "用户名不能为空";
51 return;
52 }
53
54 //判断两次密码输入是否相同
55 if( txtNewPassword.Text != txtConfirmPassword.Text )
56 {
57 controlMessage.InnerHtml = "两次输入的密码不一致,请重新输入";
58 return;
59 }
60
61 IniFile ini = new IniFile( _strServUDaemonPath );
62 string strSectionValue = "USER=" + strUserID.Trim() + "|1";
63
64 //通过读取指定用户的HomeDir来确定是否存在该用户
65 if( ini.ReadString( strSectionValue, "HomeDir", "" ) == "" )
66 {
67 controlMessage.InnerHtml = "指定的用户不存在";
68 return;
69 }
70
71 //开始判断密码是否正确
72 string strPassword = ini.ReadString( strSectionValue, "Password", "" );
73
74 string strPasswordFrontTwoChars;
75 &
| 对此文章发表了评论 |

