Autor Beitrag
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6386
Erhaltene Danke: 146

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 20.10.05 13:03 
Also, ich überwache die Prozesse auf einem PC. Das ist ja noch ziemlich einfach. Als nächstes möchte ich aber über den Prozess-Handle heraus bekommen, welches Programm, etc. dahinter steckt.
Ich habe jetzt schon fast 2 Tage gewühlt, aber irgendwie finde ich nichts passendes. Geht das überhaupt? Und falls nicht, gibts vielleicht einen anderen Weg?
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Do 20.10.05 13:43 
Hallo jasocul,

das geht über die Property MainModule und wiederum deren Property FileName:
ausblenden Beispielprogrämmchen
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Process [] arr_proc = Process.GetProcesses();
ProcessModule pm;
      
foreach(Process p in arr_proc)
{
  Console.WriteLine(p.ProcessName);
  try
  {
    pm = p.MainModule;
    Console.WriteLine(" -> {0}", pm.FileName);
  }
  catch( Exception exc)
  {
    Console.WriteLine(" -> not available");
  }
}


Gruß,
raziel

_________________
JSXGraph
jasocul Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6386
Erhaltene Danke: 146

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 20.10.05 14:00 
Habs auch gerade gefunden. Manchmal ist man echt mit Blindheit geschlagen. Wie oft muss ich das im Class-Viewer überlesen haben. *kopfschüttel*