As the title implies, is there any way I could do this?
I’m trying to do this in an .aspx, this is my current code:
<script runat="server">
//using System.Diagnostics;
Process[] processes = System.Diagnostics.Process.GetProcesses();
foreach(Process process in processes)
{
lbl = process.MainWindowTitle;
}
</script>
But it’s saying foreach isn’t a valid token.
Like everyone else said Process.GetProcesses()
If you use LinqPad you can run this in Statements mode to see how it works and play with it.