語言

WebHttpBehavior.HelpEnabled 屬性

定義

會取得或設定一個值,決定 WCF 說明頁面是否啟用。

public:
 virtual property bool HelpEnabled { bool get(); void set(bool value); };
public virtual bool HelpEnabled { get; set; }
member this.HelpEnabled : bool with get, set
Public Overridable Property HelpEnabled As Boolean

屬性值

true 如果啟用了 WCFHelp 頁面;否則 false。

備註

欲了解更多關於 WCF REST 說明頁面的資訊,請參閱 WCF Web HTTP 服務說明頁面。

要在設定檔中啟用 helpEnabled 屬性:

<system.serviceModel>
    <behaviors>
        <endpointBehaviors>
            <behavior name="MyEndpointBehavior">
                <webHttp helpEnabled="true" />
            </behavior>
    </endpointBehaviors>
</system.serviceModel>

要程式化啟用 HelpEnabled 屬性:

WebHttpBehavior helpBehavior = new WebHttpBehavior();
helpBehavior.HelpEnabled = true;
host.Description.Endpoints[0].Behaviors.Add(helpBehavior);

適用於