Enter user background Formsauthentication. setauthcookie (strusername, False );
Response. Redirect ( " ../Member/index. aspx " , True );
Obtains the profile and membership information of a user.Membershipuser mu=Membership. getuser (strusername );
Profilecommon P=Profile. getprofile (strusername );
Modify user profile informationProfilecommon P=Profile. getprofile (strusername );
P. memberinfo. Name=Truename. text;
P. Save ();
Change User Password
If the old password is known, use the changepassword control to modify it.
If you do not know the old password and do not need requiresquestionandanswer, set enablepasswordreset of membership provider to "true" in Web. config, and then use:
Membershipuser mu = Membership. getuser (strusername );
Mu. changepassword (MU. resetpassword (), tbpsw. Text );
You can change the password.
Unlock user
The unlockuser method of membershipuser can be used to unlock the lock:Membershipuser mu=Membership. getuser (strusername );
If(MU. islockedout) mu. unlockuser ();
Note that, unlike isapproved, locking is caused by incorrect user operations and does not provide a way to set locking.
Set User status
Set through the isapproved attribute of membershipuser:
Membershipuser mu = Membership. getuser (strmember );
Mu. isapproved = True ; // Set true or false based on actual conditions
Membership. updateuser (MU ); // You need to manually update the database