Environment.UserInteractive Vlastnost

Definice

Získá hodnotu určující, zda aktuální proces běží v interaktivním režimu uživatele.

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

Hodnota vlastnosti

truepokud je aktuální proces spuštěn v interaktivním režimu uživatele; v opačném případě . false

Příklady

Následující příklad zobrazuje, jestli je aktuální proces spuštěný v interaktivním režimu uživatele.

// 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
'

Poznámky

Vlastnost UserInteractive hlásí false pro proces Windows nebo službu, jako je služba IIS, která běží bez uživatelského rozhraní. Pokud je falsetato vlastnost , nezobrazovat modální dialogy nebo pole zpráv, protože neexistuje žádné grafické uživatelské rozhraní pro interakci uživatele.

Platí pro

Viz také