Environment.UserInteractive Propriedade
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Obtém um valor que indica se o processo atual está em execução no modo de interação com o usuário.
public:
static property bool UserInteractive { bool get(); };
public static bool UserInteractive { get; }
static member UserInteractive : bool
Public Shared ReadOnly Property UserInteractive As Boolean
true
se o processo atual estiver em execução no modo de interação com o usuário; caso contrário, false
.
O exemplo a seguir exibe se o processo atual está em execução no modo interativo do usuário.
// Sample for the Environment::UserInteractive property
using namespace System;
int main()
{
Console::WriteLine();
Console::WriteLine( "UserInteractive: {0}", Environment::UserInteractive );
}
/*
This example produces the following results:
UserInteractive: True
*/
// 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
'
A UserInteractive propriedade relata false
um processo do Windows ou um serviço como o IIS que é executado sem uma interface do usuário. Se essa propriedade for false
, não exiba caixas de diálogo modais ou de mensagem porque não há interface gráfica do usuário com a qual o usuário interaja.
Produto | Versões |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
Comentários do .NET
O .NET é um projeto código aberto. Selecione um link para fornecer comentários: