c# - Getting process name with extension name(.exe per example) -


i'm making program , want add processes listbox, used following code:

foreach(process p in process.getprocesses()) {    listbox1.items.add(p.processname); } 

this adds processes name like

process list

but instead see processes extensions example: chrome.exe or iexplorer.exe there programs aren't .exe xtrap.xt

edit: tried

listbox1.items.add(p.modulemain.filename); 

but throws win32exception: access denied.

set app run x64 , admin user, right click run or run vs admin.

you can use path.getfilename(p.modulemain.filename) filename full path.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -