Environment.UserInteractive 속성

정의

현재 프로세스가 사용자 대화형 모드로 실행되고 있는지를 나타내는 값을 가져옵니다.

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경우 사용자가 상호 작용할 그래픽 사용자 인터페이스가 없으므로 모달 대화 상자 또는 메시지 상자를 표시하지 마세요.

적용 대상

추가 정보