HttpApplication.GetVaryByCustomString(HttpContext, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供該屬性的全應用實作 VaryByCustom 。
public:
virtual System::String ^ GetVaryByCustomString(System::Web::HttpContext ^ context, System::String ^ custom);
public virtual string GetVaryByCustomString(System.Web.HttpContext context, string custom);
abstract member GetVaryByCustomString : System.Web.HttpContext * string -> string
override this.GetVaryByCustomString : System.Web.HttpContext * string -> string
Public Overridable Function GetVaryByCustomString (context As HttpContext, custom As String) As String
參數
- context
- HttpContext
一個 HttpContext 包含當前網路請求資訊的物件。
- custom
- String
指定用來回應當前請求的快取回應的自訂字串。
傳回
如果參數 custom 值為 "browser",則為 Type瀏覽器的;否則, null。
備註
你可以覆寫 GetVaryByCustomString ,新增一種基於當前請求的自訂變異除符值計算方法。 實作必須呼叫無法辨識的自訂值的基底類別。 欲了解更多資訊,請參閱 「如何用自訂字串快取頁面版本」。