Environment.UserInteractive-Eigenschaft
Ruft einen Wert ab, der angibt, ob der aktuelle Prozess im interaktiven Modus ausgeführt wird.
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Shared ReadOnly Property UserInteractive As Boolean
'Usage
Dim value As Boolean
value = Environment.UserInteractive
public static bool UserInteractive { get; }
public:
static property bool UserInteractive {
bool get ();
}
/** @property */
public static boolean get_UserInteractive ()
public static function get UserInteractive () : boolean
Eigenschaftenwert
true, wenn der aktuelle Prozess im interaktiven Modus ausgeführt wird, andernfalls false.
Hinweise
Die UserInteractive-Eigenschaft gibt für einen Windows-Prozess oder einen Dienst wie IIS, der ohne Benutzeroberfläche ausgeführt wird, false zurück. Wenn diese Eigenschaft false ist, dürfen Sie keine modalen Dialogfelder oder Meldungsfelder anzeigen, da keine grafische Benutzeroberfläche für die Interaktion mit dem Benutzer vorhanden ist.
Beispiel
Im folgenden Codebeispiel wird angezeigt, ob der aktuelle Prozess im interaktiven Modus ausgeführt wird.
' Sample for the Environment.UserInteractive property
Imports System
Class Sample
Public Shared Sub Main()
Console.WriteLine()
Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive)
End Sub 'Main
End Class 'Sample
'
'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
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
import System.*;
class Sample
{
public static void main(String[] args)
{
Console.WriteLine();
Console.WriteLine("UserInteractive: {0}",
System.Convert.ToString(Environment.get_UserInteractive()));
} //main
} //Sample
/*
This example produces the following results:
UserInteractive: True
*/
Plattformen
Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.
Versionsinformationen
.NET Framework
Unterstützt in: 2.0, 1.1, 1.0
Siehe auch
Referenz
Environment-Klasse
Environment-Member
System-Namespace
SystemInformation