문제

Is it possible to get the password of a user? How, please? When I've tried this code :

WebSecurity.InitializeDatabaseConnection("nectarys-pc.MonitoringN.dbo", "Superviseur", "UserId", "matricule", autoCreateTables: true);
var membership = (SimpleMembershipProvider)Membership.Provider;
model.motDePasse = membership.GetUser(superviseur.matricule, false).GetPassword();

This exception appears in the last line :

System.NotSupportedException: Specified method is not supported.

How to deal this?

Note that superviseur.matricule is not the source of the problem.

도움이 되었습니까?

다른 팁

Checking MSDN for GetPassword shows you that it throws the System.NotSupportedException when "EnablePasswordRetrieval is false."

You can change EnablePasswordRetrieval in your web.config

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top