Environment.UserInteractive Propriedade

Definição

Recebe um valor que indica se o processo atual está a correr em modo interativo para o utilizador.

public:
 static property bool UserInteractive { bool get(); };
public static bool UserInteractive { get; }
static member UserInteractive : bool
Public Shared ReadOnly Property UserInteractive As Boolean

Valor de Propriedade

true se o processo atual estiver a correr em modo interativo com o utilizador; caso contrário, false.

Exemplos

O exemplo seguinte mostra se o processo atual está a correr em modo interativo para o utilizador.

// Sample for the Environment.UserInteractive property
using System;

class Sample
{
    public static void Main()
    {
    Console.WriteLine();
    Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive);
    }
}
/*
This example produces the following results:

UserInteractive: True
*/
// Sample for the Environment.UserInteractive property
open System

printfn $"\nUserInteractive: {Environment.UserInteractive}"

// This example produces the following results:
//     UserInteractive: True
' Sample for the Environment.UserInteractive property
Class Sample
   Public Shared Sub Main()
      Console.WriteLine()
      Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive)
   End Sub
End Class
'
'This example produces the following results:
'
'UserInteractive: True
'

Observações

Os relatórios de propriedades UserInteractivefalse para um processo Windows ou um serviço como o IIS que corre sem interface de utilizador. Se esta propriedade for false, não mostre diálogos modais ou caixas de mensagens porque não existe uma interface gráfica para o utilizador interagir.

Aplica-se a

Ver também