473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Listing applications

How would you make a list of running applications in c#
Nov 15 '08 #1
5 964
joedeene
583 512MB
You can use the Process Class to get a list of running processes? Here's a sample code that adds the process name to a listbox.

Expand|Select|Wrap|Line Numbers
  1.  private void button1_Click(object sender, EventArgs e)
  2.         {
  3.          foreach (System.Diagnostics.Process proc in System.Diagnostics.Process.GetProcesses())
  4.          {
  5.              listBox1.Items.Add(proc.ProcessName);
  6.  
  7.          }
  8.         }
Does something like that work for you?

joedeene
Nov 15 '08 #2
Yeah that works but what i really need is a list of running applications e.x. not notepad.exe but the file that goes with notepad.exe
Nov 15 '08 #3
joedeene
583 512MB
...Could you explain? You want the file with notepad.exe? Do you mean the StartUp path, and location, of the process? Or the file opened with notepad?

joedeene
Nov 15 '08 #4
ok...my main goal with this is to have a user type in an application(or selecet one from a list) and find the owner or user name of the person/thing useing that application. For example someone types in "C:\Test.txt" and it would find who is useing that file
Nov 16 '08 #5
balabaster
797 Expert 512MB
I'd hit CTRL+ALT+DEL and look at task manager...

Of course, if I wanted to do it programmatically I'd probably reference WMI and "Select * From Win32_Process"

WMI is extremely powerful for accessing and programmatically controlling administrative tasks.

It should also give you access to the list of currently active processes and which user/principal is in control of that process. I'm not sure however if it'll tell you which file is being used by which.

You can also find this information administratively in Computer Management/Shared Files

I've never had to programmatically do this though - I'll do some more digging and figure out what I can find...
Nov 16 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Mr. B | last post by:
In my application which allows a user to open specific AutoCAD script files (SCR extension), I want to intoduce a listing of the 10 most recently opened files. I know of at least two ways that I...
10
by: ibic | last post by:
Just curious: is it possible to recursively list all the directorys/files inside a given directory using standard c i/o library routines only, which can be re-compiled and run on any os supportes c...
3
by: Mr. B | last post by:
In my application which allows a user to open specific AutoCAD script files (SCR extension), I want to intoduce a listing of the 10 most recently opened files. I know of at least two ways that I...
3
by: Mr. B | last post by:
In my application which allows a user to open specific AutoCAD script files (SCR extension), I want to intoduce a listing of the 10 most recently opened files. I know of at least two ways that I...
2
by: Tim_Mac | last post by:
this could be seen as petty... but i noticed if you browse a folder on a .net 2 virtual directory, you get the directory listing. but the font styles are set to 8 point verdana which is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.