How to get the interactive user's name from service | ||||||||||||
|
||||||||||||
The compiled and ready for tests version of this example is available here (zip, 256Kb). "How to use" instructions are inside. |
||||||||||||
It is well known that the GetUserName API function should be used to get the name of current user. For Windows NT it means the name of user whose profile was used to create and run the process. Sometimes service application needs to know the name of the currently logged on user. The GetUserName will not help in this case because service usually starts in the specific account, and the Local System account is typical. This example shows how to get this information from service. To get the name of interactive user it is necessary to perform the following operations:
|
||||||||||||
The full source code of this example is here (zip, 3.5Kb) |
||||||||||||
Index | Step 1 | Step 2 | Step 3 | Step 4 |>> | ||||||||||||
Add your comment | Read comments |
© 1998-2001
Alexey Dynnikov |