HostProtectionAttribute.SelfAffectingProcessMgmt 속성
정의
자체 영향 프로세스 관리가 노출되는지 여부를 나타내는 값을 가져오거나 설정합니다.Gets or sets a value indicating whether self-affecting process management is exposed.
public:
property bool SelfAffectingProcessMgmt { bool get(); void set(bool value); };
public bool SelfAffectingProcessMgmt { get; set; }
member this.SelfAffectingProcessMgmt : bool with get, set
Public Property SelfAffectingProcessMgmt As Boolean
속성 값
자체 영향 프로세스 관리가 노출되면 true
이고, 그렇지 않으면 false
입니다.true
if self-affecting process management is exposed; otherwise, false
. 기본값은 false
입니다.The default is false
.
예제
다음 코드 예제에서는 속성을 사용 하 여 특성을 사용 하는 방법을 보여 줍니다 HostProtectionAttribute SelfAffectingProcessMgmt .The following code example illustrates the use of the HostProtectionAttribute attribute with the SelfAffectingProcessMgmt property. 이 예제는에 대해 제공 된 큰 예제의 일부는 HostProtectionAttribute 클래스입니다.This example is part of a larger example provided for the HostProtectionAttribute class.
// Use the enumeration flags to indicate that this method exposes shared state and
// self-affecting process management.
// Either of the following attribute statements can be used to set the
// resource flags.
// Exit the sample when an exception is thrown.
[HostProtection(SharedState=true,SelfAffectingProcessMgmt=true)]
[HostProtection(Resources=HostProtectionResource::SharedState|
HostProtectionResource::SelfAffectingProcessMgmt)]
static void Exit( String^ Message, int Code )
{
Console::WriteLine( "\nFAILED: {0} {1}", Message, Code );
Environment::ExitCode = Code;
Environment::Exit( Code );
}
// Use the enumeration flags to indicate that this method exposes
// shared state and self-affecting process management.
// Either of the following attribute statements can be used to set the
// resource flags.
[HostProtectionAttribute(SharedState = true,
SelfAffectingProcessMgmt = true)]
[HostProtectionAttribute(Resources = HostProtectionResource.SharedState |
HostProtectionResource.SelfAffectingProcessMgmt)]
private static void Exit(string Message, int Code)
{
// Exit the sample when an exception is thrown.
Console.WriteLine("\nFAILED: " + Message + " " + Code.ToString());
Environment.ExitCode = Code;
Environment.Exit(Code);
}
' Use the enumeration flags to indicate that this method exposes
' shared state and self-affecting process management.
' Either of the following attribute statements can be used to set the
' resource flags.
<HostProtectionAttribute(SharedState := True, _
SelfAffectingProcessMgmt := True), _
HostProtectionAttribute( _
Resources := HostProtectionResource.SharedState Or _
HostProtectionResource.SelfAffectingProcessMgmt)> _
Private Shared Sub [Exit](ByVal Message As String, ByVal Code As Integer)
' Exit the sample when an exception is thrown.
Console.WriteLine((ControlChars.Lf & "FAILED: " & Message & " " & _
Code.ToString()))
Environment.ExitCode = Code
Environment.Exit(Code)
End Sub
설명
자체 영향 프로세스 관리 코드는 현재 프로세스를 종료 하 고 서버를 종료할 수 있습니다.Self-affecting process management code might exit the current process, terminating the server.