Solved

User of a process

Posted on 2006-11-15
8
165 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
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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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