简体   繁体   中英

Getting the name of a process in VB.NET

I've been looking around for how to find the name of a process object gotten using System.Diagnostics.Process.GetProcesses (for instance, for the process firefox , 'Firefox') , and haven't been able to find anything. I've tried using MainWindowTitle, but instead of returning 'Firefox' it returns the name of the current tab, as that's what Firefox names it's window. Is there any way to find the actual display name of a process?

For Each p As Process In Process.GetProcesses()
    Debug.WriteLine(p.ProcessName)
Next

This might work, but is untested. https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.processname

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM