how to get FullName(path) from Process ID
For example if int id = 234
how to find the location of id;
int Id = Convert.ToInt32(lvprocesslist.SelectedItems[0].SubItems[1].Text);
string s = Process.GetProcessById(Id).MainModule.FileName;
Console.WriteLine(Path.GetFullPath(s));
its not working开发者_如何学Go under a windows PID, (notepad with 3704) not working
thankyou.
You can try this
string s = Process.GetProcessById(2028).MainModule.FileName;
Try Process.GerProcessById(234).MainModule.FileName
精彩评论