How to Get the logged in User name in a Windows Service App

  • Thread starter Thread starter Jim Covington
  • Start date Start date
J

Jim Covington

I am writing a program that needs certain information from a pc on a
network. I have it written and it is a vb.net service. I need the
logged in user name. The app now returns a user "SYSTEM" because it is
a service. How does one get the logged in user?

Also, I need the IPAddress, THe Service Pack Level of the OS, and other
system information.

Can anyone point me to the appropriate class?


YBraker
 
How does one get the logged in user?

Not sure on that one.
Also, I need the IPAddress
System.Net.Dns.Resolve(System.Net.Dns.GetHostName).AddressList(0).ToString

THe Service Pack Level of the OS, and other
system information.

Environment.Version.Major
Environment.Version.Minor
Environment.Version.Build
Environment.Version.Revision
Environment.Version.ToString
Environment.OSVersion.Platform
Environment.OSVersion.Version.ToString
Environment.OSVersion.ToString
 
Hi Jim,

Have a look at the system.management class.

(You have to set a reference for that to use it)

I hope this helps?

Cor
 
Back
Top