I have a vb program that runs as a service. I currently have code that can get the user that is currently logged in, but I have no idea when to run it, so it is currently in a timer. All I need is an event that is triggered when a user logs on. I attatched the code I use to get the current user in case anyone is interested.
Dim User As String = ""
Dim q1 As New ManagementObjectSearcher("select * from Win32_ComputerSystem")
Dim qc As ManagementObjectCollection = q1.Get
For Each Mo As ManagementObject In qc
User = Mo("username")