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:
Imports System.Data Imports System.Timers Imports System.Data.SqlClient Imports System.Diagnostics Public Class Form1 Private Sub GetProcessIDstats(ByVal strIP As String) Dim procList() As Process = Process.GetProcesses(strIP) Dim i As Integer For Each procList(i) In procList Dim strProcID As Double = procList(i).Id Dim strProcName As String = procList(i).ProcessName Dim dblVMem As Double = (procList(i).PagedMemorySize64) / 1024 If dblVMem > 100000 Then lbProcessList.Items.Add( _ strProcName & " - " & _ strProcID.ToString & " - " & _ dblVMem.ToString) End If Next End Sub Private Sub btShowProcess_Click( _ ByVal sender As System.Object, _ ByVal e As System.EventArgs) _ Handles btShowProcess.Click GetProcessIDstats("192.168.1.10") End Sub End Class




Reply With Quote