Solved

User of a process

Posted on 2006-11-15
8
168 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 6

Accepted Solution

by:
riyazthad earned 450 total points
ID: 17951347
Imports System.Diagnostics

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

Author Comment

by:Stendor
ID: 17951935
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
ID: 17957095
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

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

0
 
LVL 6

Expert Comment

by:riyazthad
ID: 17957424
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
ID: 17957521
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
ID: 17958854
0
 
LVL 1

Author Comment

by:Stendor
ID: 17964909
thanx you show me the way and gave me some good ideas thanx
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

705 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