C#.NET Getting User Name of machine using Windows Service
问题 I am having difficulty getting the User Name of a person logged into a machine using a windows service. When using both System.Environment.UserName or WindowsIdentity.GetCurrent().UserName I get NTAUTHORITY\SYSTEM but when this application gets pushed I need to be able to map to the UserID of the person logged in to the system. The operating system this will be used on will be Windows XP. Any help would be very appreciated. 回答1: For XP only, this advice should apply: Get Window Station for a