Is there a way to get running applications of task manager (not the processes) from another computer? By any chance using the other pc's IP Address or pc name?
Here's my code but all it does is displaying my running applications and updates every second to see if I open or close any program.
UPDATE: I used impersonator but I still get the same error "Couldn't connect to machine". As for the impersonator, I just downloaded this Impersonator
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
private void running_process()
{
DataTable dt = new DataTable();
dt.Columns.Add("ProcessName");
dt.Columns.Add("ProcessId");
using (new Impersonator("adminuser", "", "adminpass"))
{
Process[] processes = Process.GetProcessesByName(".", "PCNAME");
//Process.GetProcesses("192.168.20.120")
foreach (Process p in processes)
{
try
{
if (p.MainWindowTitle.Length > 0)
{
dt.Rows.Add();
dt.Rows[dt.Rows.Count - 1][0] = p.MainWindowTitle;
dt.Rows[dt.Rows.Count - 1][2] = p.Id.ToString();
}
}
catch { }
}
}
listBox1.DataSource = dt;
listBox1.DisplayMember = "ProcessName";
listBox1.ValueMember = "ProcessId";
}
private void timer1_Tick(object sender, EventArgs e)
{
running_process();
}