Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

User of a process

Hi experts

I have a small program in vb.net that checks if a process is running in a computer I would like to be able to know which user is running that process if I could get some help with that I’ll be really grateful.
 

Thanx one more time experts.
0
Steven
Asked:
Steven
  • 4
  • 4
1 Solution
 
riyazthadCommented:
Imports System.Diagnostics

  Dim pr As New Process
        pr = Process.GetCurrentProcess
        Dim s As String = pr.MachineName
0
 
StevenAuthor Commented:
Thanx for your answer but I get a "."
if I try this instead of getting the username or the machine name

TextBox2.Text = s.ToString
0
 
riyazthadCommented:
you created a program and you are running from your machine. Then it will return only ur machine name. I guess dot means current machine.

What is your ultimate aim?

0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
StevenAuthor Commented:
what I want is to check in my terminal server wich user or computer is using what process

0
 
riyazthadCommented:
Why you dont use System.Security.Principal.WindowsIdentity.GetCurrent.Name

each time user start your process from remote machine, u can just copy to a text file in server or database.

Is that what u want?
0
 
StevenAuthor Commented:
Let me be more specific I have an application on a server and some stations connect to this server with their own session I need to check if they are running the application if not I want to start it.
0
 
StevenAuthor Commented:
thanx you show me the way and gave me some good ideas thanx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now