Environment.UserInteractive 속성
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
현재 프로세스가 사용자 대화형 모드로 실행되고 있는지를 나타내는 값을 가져옵니다.
public:
static property bool UserInteractive { bool get(); };
public static bool UserInteractive { get; }
static member UserInteractive : bool
Public Shared ReadOnly Property UserInteractive As Boolean
현재 프로세스가 사용자 대화형 모드로 실행되고 있으면true
이고, 그렇지 않으면 false
입니다.
다음 예제에서는 현재 프로세스가 사용자 대화형 모드에서 실행 중인지 여부를 표시합니다.
// 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
'
속성은 UserInteractive Windows 프로세스 또는 사용자 인터페이스 없이 실행되는 IIS와 같은 서비스에 대해 보고 false
합니다. 이 속성이 인 false
경우 사용자가 상호 작용할 그래픽 사용자 인터페이스가 없으므로 모달 대화 상자 또는 메시지 상자를 표시하지 마세요.
제품 | 버전 |
---|---|
.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 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.