Leggere in inglese

Condividi tramite


Environment.UserInteractive Proprietà

Definizione

Ottiene un valore che indica se il processo corrente viene eseguito in modalità interattiva utente.

C#
public static bool UserInteractive { get; }

Valore della proprietà

true se il processo corrente viene eseguito in modalità interattiva utente; in caso contrario, false.

Esempio

Nell'esempio seguente viene visualizzato se il processo corrente è in esecuzione in modalità interattiva dell'utente.

C#
// 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
*/

Commenti

La UserInteractive proprietà segnala false un processo di Windows o un servizio come IIS che viene eseguito senza un'interfaccia utente. Se questa proprietà è false, non visualizzare finestre di dialogo modali o finestre di messaggio perché non è disponibile alcuna interfaccia utente grafica con cui l'utente può interagire.

Si applica a

Prodotto Versioni
.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

Vedi anche