Solved

User of a process

Posted on 2006-11-15
8
163 Views
Last Modified: 2010-04-23
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
Comment
Question by:Stendor
  • 4
  • 4
8 Comments
 
LVL 6

Accepted Solution

by:
riyazthad earned 450 total points
Comment Utility
Imports System.Diagnostics

  Dim pr As New Process
        pr = Process.GetCurrentProcess
        Dim s As String = pr.MachineName
0
 
LVL 1

Author Comment

by:Stendor
Comment Utility
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
 
LVL 6

Expert Comment

by:riyazthad
Comment Utility
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
 
LVL 1

Author Comment

by:Stendor
Comment Utility
what I want is to check in my terminal server wich user or computer is using what process

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 6

Expert Comment

by:riyazthad
Comment Utility
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
 
LVL 1

Author Comment

by:Stendor
Comment Utility
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
 
LVL 6

Expert Comment

by:riyazthad
Comment Utility
0
 
LVL 1

Author Comment

by:Stendor
Comment Utility
thanx you show me the way and gave me some good ideas thanx
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now