Does anybody have a Function to get the username from task manager? I have this code that I gets me everything I need but the username. From what I have read it appears that I need to query Windows WMI but I am not real sure what that means.

VB Code:
  1. Imports System.Data
  2. Imports System.Timers
  3. Imports System.Data.SqlClient
  4. Imports System.Diagnostics
  5. Public Class Form1
  6.     Private Sub GetProcessIDstats(ByVal strIP As String)
  7.         Dim procList() As Process = Process.GetProcesses(strIP)
  8.         Dim i As Integer
  9.         For Each procList(i) In procList
  10.             Dim strProcID As Double = procList(i).Id
  11.             Dim strProcName As String = procList(i).ProcessName
  12.             Dim dblVMem As Double = (procList(i).PagedMemorySize64) / 1024
  13.             If dblVMem > 100000 Then
  14.                 lbProcessList.Items.Add( _
  15.                     strProcName & " - " & _
  16.                     strProcID.ToString & " - " & _
  17.                     dblVMem.ToString)
  18.             End If
  19.         Next
  20.     End Sub
  21.  
  22.     Private Sub btShowProcess_Click( _
  23.         ByVal sender As System.Object, _
  24.         ByVal e As System.EventArgs) _
  25.         Handles btShowProcess.Click
  26.  
  27.         GetProcessIDstats("192.168.1.10")
  28.  
  29.     End Sub
  30. End Class