I have posted another post for resetting the lost passwords through the database. Today I am going to show how to get the password through a C# code.
DotNetNuke is using a highly secured encrypted method to save passwords to the system. I am not going to explain it here. In some other cases you may need to retrieve the saved passwords. It won’t possible to read it via SQL tables because of it is encrypted.
But if you want to compare the passwords with your logged in user or with your passing password string you can use this method.
This method is giving the password of logged in user. But you can customize it as your requirement.
DotNetNuke is using a highly secured encrypted method to save passwords to the system. I am not going to explain it here. In some other cases you may need to retrieve the saved passwords. It won’t possible to read it via SQL tables because of it is encrypted.
But if you want to compare the passwords with your logged in user or with your passing password string you can use this method.
public string ReturnPw() { UserController uc = new UserController(); UserInfo ui = new UserInfo(); if (UserId > 0) { ui = uc.GetUser(this.PortalId, this.UserId); string un = ui.Username.ToString(); UserInfo oUser = UserController.GetUserByName(this.PortalId, un); if (oUser != null) { //Get the password string pwrd = UserController.GetPassword(ref oUser, ""); return pwrd; } } return "N/A"; }
This method is giving the password of logged in user. But you can customize it as your requirement.
Sunday, May 09, 2010 11:56:00 AM
Gr8 post. Thanks 4 the tip. Keep it up !
Sunday, May 09, 2010 12:24:00 PM
You are welcome Shaun
Sunday, May 16, 2010 4:31:00 PM
Hi, Good post! It will definitely help dotnetnuke users.
I wanted to talk to you about something. Can I please contact you? Chat With Me widget in your sidebar is showing disabled! Can you please contact me here: http://bloggingwithsuccess.net/about/contact-us
Thanks for your time.
Sunday, May 16, 2010 5:18:00 PM
Thank you Ishan,
Chat with me widget is enable always when I am online on skype through my machine or my mobile.
Most of the time I am online and you can contact me through skype.
More Dotnetnuke tips are on the way. :-)
Tnx
PM
Friday, November 09, 2012 10:40:00 AM
I coulԁ nоt rеsіst сommenting.
Ρerfectlу written!
Also visit my web page - roulette Sniper
Tuesday, January 15, 2013 9:42:00 PM
Tuesday, January 15, 2013 9:47:00 PM
Post your free articles,comments and backlinks here.
http://www.business-article-directory.com
Thursday, June 13, 2013 4:24:00 PM
Hi prasad,
Nice post ,very interesting.Thanks for sharing .
Dotnetnuke cms
Thursday, June 13, 2013 4:27:00 PM
You are welcome Johnson ! Now my official blog is here.
www.prasadmaduranga.com/blog