The source code to check whether a process is running in user interactive mode or not using Environment class is given below. The given program is compiled and executed successfully.
using System;
class Sample
{
//Entry point of Program
static public void Main()
{
bool isUserInteractiveMode = false;
isUserInteractiveMode = Environment.UserInteractive;
if (isUserInteractiveMode == true)
Console.WriteLine("Process is running in user interactive mode");
else
Console.WriteLine("Process is not running in user interactive mode");
}
}
Output:
Process is running in user interactive mode
Press any key to continue . . .
Program:
The source code to check whether a process is running in user interactive mode or not using Environment class is given below. The given program is compiled and executed successfully.
Output: