开发者

C# .net Get FullName from Process ID

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜