Hi.
I had created a Windows Application ant put there the code down there. I am
trying to get information about the processes that are currently running in
my machine.
The problem is: "Arguments" property is always an empty string (the same
happens to "Filename" property).
Could it be a permission problem? My pc is running Windows XP SP1 and I
always run the application logged with a user that belongs to the
"Administrators" group, so he is an administrator.
I would appreciate some help.
Thank you.
Ric
===============================================
private void Form1_Load(object sender, System.EventArgs e)
{
DataTable dt = new DataTable();
dt.Columns.Add("col1");
dt.Columns.Add("col2");
dt.Columns.Add("col3");
dt.Columns.Add("col4");
dt.Columns.Add("col5");
dt.Columns.Add("col6");
dataGrid1.DataSource = dt;
Process[] procs = System.Diagnostics.Process.GetProcesses();
foreach(Process p in procs) {
dt.Rows.Add(new object[6] { p.ProcessName, p.StartInfo.FileName,
p.StartInfo.Arguments, p.MainWindowTitle,
p.Threads.Count,
p.StartInfo.WorkingDirectory });
}
dataGrid1.Refresh();
}