Create environment variables for a new user in C#

丶灬走出姿态 提交于 2019-12-01 06:41:19

Yes, from C# you can P/Invoke the LoadUserProfile Win32 API function. This will create the user's profile if it does not already exist, and load the user's registry hive.

I would not recommend this approach for an account that will be used for interactive logons, but it should be safe enough for a service account.

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