开发者

user creating/saving

开发者 https://www.devze.com 2022-12-27 04:34 出处:网络
i want to write 2 program: 1) programm saves all local usersto the file. 2) loads file find that users not fou开发者_如何转开发nd on local machine and create user.

i want to write 2 program:

1) programm saves all local users to the file.

2) loads file find that users not fou开发者_如何转开发nd on local machine and create user.

for searching all users which create on local machine i use next code:

foreach (ManagementObject user in userSearcher.Get())
{
    if ((bool)user["LocalAccount"])
    {
        string UserName = (string)user["FullName"];
    }
}

How can i save the settings of user by name and create user?


To create users you can use the DirectoryEntry class.

0

精彩评论

暂无评论...
验证码 换一张
取 消