Home > database >  Bosses, how to modify the login password in another window, login password is fixed, no links databa
Bosses, how to modify the login password in another window, login password is fixed, no links databa

Time:09-28

Private void btnLogin_Click (object sender, EventArgs e)
{
If (txtUser. Text. The ToString ()=="123456" & amp; & TxtPassword. Text. The ToString ()=="123456")
{
This. Hide ();
ManagementForm eManagementForm=new ManagementForm ();
EManagementForm. ShowDialog ();
Enclosing the Close ();
}
The else
{
MessageBox. Show (" the user name or password error!" );
}

CodePudding user response:

Problem description specific again, whether want to put the user name and password are passed to the second window? The simplest way is to change the window 2 Modifier in the text box attributes to public, you can directly call:
EManagementForm. TxtUserName=this. TxtUser. Text;
EManagementForm. TxtUserPwd=this. TxtPassword. Text;
EManagementForm. ShowDialog ();

CodePudding user response:

reference 1st floor datafansbj response:
problem description specific again, whether want to put the user name and password are passed to the second window? The simplest way is to change the window 2 Modifier in the text box attributes to public, you can directly call:
EManagementForm. TxtUserName=this. TxtUser. Text;
EManagementForm. TxtUserPwd=this. TxtPassword. Text;
EManagementForm. ShowDialog ();

Is to modify the previous password in the second window

CodePudding user response:

The code above spelling has a problem, there is no validated, principle is no problem, should be changed to the following:
EManagementForm. TxtUserName. Text=this. TxtUser. Text;
EManagementForm. TxtUserPwd1. Text=this. TxtPassword. Text;
EManagementForm. TxtUserPwd2. Text=this. TxtPassword. Text;
EManagementForm. ShowDialog ();