熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> .NET編程 >> 正文

連鎖中心配送系統:用戶密碼的修改[3]

2022-06-13   來源: .NET編程 
    ——此文章摘自《ASPNET +SQL Server網絡應用系統開發案例精解》定價 特價 詳細>>http://tracklinktechcn/?m_id=dangdang&a_id=A&l=&l_type= width= height= border= nosave>

                       }
             }
             else
             {
                       ResponseRedirect(/Indexaspx);
             }
           
    }
    //單擊修改按鈕所觸發的事件
    private void STUpdate_ok_Click(object sender SystemEventArgs e)
    {
             //判斷原密碼是否為空
             if(STOld_pwdText == Session[STUserPwd]ToString() && STOld_pwdText != )
             {
                       //判斷新密碼和確認密碼是否為空是否相等
                       if(STNew_pwdText == Tbx_pwdokText && STNew_pwdText != && Tbx_pwdokText !=)
                       {
                                //獲得數據庫連接字符串
                                string STconnection = ConfigurationSettingsAppSettings[strconnection];
                                SqlConnection STconn = new SqlConnection(STconnection);
                                STconnOpen();
                                //根據文本框裡的內容創建修改密碼的sql語句
                                string STstrsql=update STUser set STUserPwd = + STNew_pwdText + where STNickName = + STNickName+;
                                SqlCommand STcmd = new SqlCommand(STstrsqlSTconn);
                                try
                                {
                                         //執行sql語句
                                         STcmdExecuteNonQuery();
                                         //提示修改成功
                                         STUserPwdText=修改成功!;
                                         ResponseRedirect(STUserInfoaspx);
                                }
                                catch(SqlException)
                                {
                                         STUserPwdText=修改有誤!;
                                         STUserPwdVisible=true;
                                }
                                STconnClose();
                       }
                       else
                       {
                                STUserPwdText = 確認密碼不正確!;
                       }
             }
             else
             {
                       STUserPwdText = 原密碼不正確!;
             }
    }

right>[http://developcsaicn/dotnet_ASP/htm>]  [http://developcsaicn/dotnet_ASP/htm>]  []  


From:http://tw.wingwit.com/Article/program/net/201311/15331.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.