void ChangePassword_ButtonChange() { changepassword.labelMessege.Text = ""; String error = "", curp = "", newp = ""; bool er = false; curp = changepassword.textBoxPass.Text; if (!user_password.Equals(curp)) { error = "Incorrect Current Password\n"; er = true; } if (changepassword.textBoxNewPass.Text != changepassword.textBoxRePass.Text) { error = "New and Re-Entr New Passord Not Match\n"; er = true; } else { newp = changepassword.textBoxNewPass.Text; } if (er) { changepassword.labelMessege.Text = error; } else { try { if (remoteObject.ChanegeUserPasswod(user_name, user_password, newp)) { user_password = newp; changepassword.labelMessege.Text = "Password Changed Successfully"; changepassword.textBoxPass.Text = ""; changepassword.textBoxNewPass.Text = ""; changepassword.textBoxRePass.Text = ""; } else { changepassword.labelMessege.Text = "Password Cannot Changed"; } } catch (Exception ex) { MessageBox.Show("Form1.ChangePassword_ButtonChange()" + ex.Message); } } } // eof ChangePassword_ButtonChange()