ServiceSecurityAuditBehavior.MessageAuthenticationAuditLevel 屬性

定義

取得或設定要在訊息層級稽核的驗證事件類型。

public:
 property System::ServiceModel::AuditLevel MessageAuthenticationAuditLevel { System::ServiceModel::AuditLevel get(); void set(System::ServiceModel::AuditLevel value); };
public System.ServiceModel.AuditLevel MessageAuthenticationAuditLevel { get; set; }
member this.MessageAuthenticationAuditLevel : System.ServiceModel.AuditLevel with get, set
Public Property MessageAuthenticationAuditLevel As AuditLevel

屬性值

其中一個 AuditLevel 列舉值。 預設為 None

例外狀況

setvalue 不是 AuditLevel 的有效成員。

範例

下列程式碼會建立 ServiceSecurityAuditBehavior 類別的執行個體,並設定這個屬性。

// Create a new auditing behavior and set the log location.
ServiceSecurityAuditBehavior newAudit =
    new ServiceSecurityAuditBehavior();
newAudit.AuditLogLocation =
    AuditLogLocation.Application;
newAudit.MessageAuthenticationAuditLevel =
    AuditLevel.SuccessOrFailure;
newAudit.ServiceAuthorizationAuditLevel =
    AuditLevel.SuccessOrFailure;
newAudit.MessageAuthenticationAuditLevel = _
    AuditLevel.SuccessOrFailure
newAudit.ServiceAuthorizationAuditLevel = _
    AuditLevel.SuccessOrFailure

備註

Windows Communication Foundation (WCF) 服務應用程式具有兩個層級,其中可以強制執行安全性。 在 服務 層級,服務的所有方法都會由相同的安全性原則強制執行。 服務中的個別方法可以有不同的 (更嚴格的) 安全性原則。 您可以使用 MessageAuthenticationAuditLevel 屬性來控制要稽核的訊息層級事件。

您也可以在用戶端應用程式組態檔中使用< serviceSecurityAudit >來設定此值。

適用於