Environment.UserInteractive Egenskap

Definition

Hämtar ett värde som anger om den aktuella processen körs i interaktivt användarläge.

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

Egenskapsvärde

trueom den aktuella processen körs i interaktivt användarläge; annars . false

Exempel

I följande exempel visas om den aktuella processen körs i interaktivt användarläge.

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

Kommentarer

Egenskapen UserInteractive rapporterar false för en Windows process eller en tjänst som IIS som körs utan användargränssnitt. Om den här egenskapen är falseska du inte visa modala dialogrutor eller meddelanderutor eftersom det inte finns något grafiskt användargränssnitt för användaren att interagera med.

Gäller för

Se även