How to set user account password without knowing the old password in C?

左心房为你撑大大i 提交于 2019-12-21 20:11:50

问题


I'm writing a C++ program to manage user accounts on Windows 7.

I would like to set the password for an existing user account.

I cannot use NetUserChangePassword (Netapi32.dll) since I don't record previous password that I set when creating the user.

So, the program must be able to just set a new password (without knowing the old password).

Is there a way to do that programmatically in c++?

Thank you for your help.


回答1:


Call NetUserSetInfo with the level parameter set to 1003.



来源:https://stackoverflow.com/questions/14215626/how-to-set-user-account-password-without-knowing-the-old-password-in-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!