Hi All,
I'm fairly new to vb.net and seem to be struggling to get a piece of information I need for a project at work!
Basically I can list all the applications running on a machine, I cannot however retrieve the details of the user running it!
At the moment I'm using the following code after importing System.ServiceProcess and System.Diagnostics.Process:
Public Sub GetProcess()
Dim pr As Process
A = 0
For Each pr In Process.GetProcesses(System.Environment.MachineName)
ReDim Preserve arrProcess(A)
arrProcess(A) = New String() {pr.ProcessName.ToString, Process.GetCurrentProcess.PrivateMemorySize64}
A = A + 1
Next
End Sub
I have tried using pr.StartInfo.UserName but that just returns the username of the person logged onto the machine.
Any help would be much appreciated!
Thank you!
Simon
I'm fairly new to vb.net and seem to be struggling to get a piece of information I need for a project at work!
Basically I can list all the applications running on a machine, I cannot however retrieve the details of the user running it!
At the moment I'm using the following code after importing System.ServiceProcess and System.Diagnostics.Process:
Public Sub GetProcess()
Dim pr As Process
A = 0
For Each pr In Process.GetProcesses(System.Environment.MachineName)
ReDim Preserve arrProcess(A)
arrProcess(A) = New String() {pr.ProcessName.ToString, Process.GetCurrentProcess.PrivateMemorySize64}
A = A + 1
Next
End Sub
I have tried using pr.StartInfo.UserName but that just returns the username of the person logged onto the machine.
Any help would be much appreciated!
Thank you!
Simon