elektrobank
Member
- Joined
- Aug 11, 2008
- Messages
- 19
- Programming Experience
- 10+
Can I do this in VB.NET?
I'm trying to loop through processes, but keep getting an access denied error when it comes across services. I found this code which is supposed to fix that, can it be done in VB though?
Thanks!
VB.NET:
foreach (Process process in
System.Diagnostics.Process.GetProcesses().Where( process =>
{
bool hasException = false;
try { IntPtr x = process.Handle; }
catch { hasException = true; }
return !hasException;
})
)
{
// ...
}
Thanks!