Find out the current user's username - when multiple users are logged on

后端 未结 3 1412
我在风中等你
我在风中等你 2021-01-24 15:50

\"User A\" is logged on My application recognizes Environment.Username as \"User A\"

Now in Windows, I click on Switch user ... \"User B\" logs on

\"User A\'s\"

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-24 16:34

    You definitely wont be finding the information at that level - you want to go to lower level APIs that enuemrate the logged on users (of which there can be more than one).

    Something like How to write an application that supports the Fast User Switching feature by using Visual Basic .NET or Visual Basic 2005 in Windows XP ?

    See also Architecture of Fast User Switching

提交回复
热议问题