-3

I have a Windows Forms application. I need an if statement that if a specific procces is running, the label on my form would change color and text. Can I build an if statement that will allow me to do that?

I've been trying

if (Process.GetProcessesByName("RobloxPlayerBeta").Length != 0)

but it would not work.

yacc
  • 2,915
  • 4
  • 19
  • 33
THE FLASH
  • 1
  • 5
  • 1
    Does this answer your question? [How can I know if a process is running?](https://stackoverflow.com/questions/262280/how-can-i-know-if-a-process-is-running) – yacc May 10 '20 at 15:19

1 Answers1

-1

Try this one.

if (Process.GetProcessesByName("process_name").Length > 0)
{
    // Is running
}