请单击以进行评分并提供反馈
MSDN
MSDN Library
.NET 开发
.NET Framework
 GetVaryByCustomString 方法

  开启低带宽视图
此页面仅适用于
Microsoft Visual Studio 2008/.NET Framework 3.5

同时提供下列产品的其他版本:
.NET Framework 类库
HttpApplication..::.GetVaryByCustomString 方法

更新:2007 年 11 月

提供 VaryByCustom 属性在整个应用程序范围内的实现。

命名空间:  System.Web
程序集:  System.Web(在 System.Web.dll 中)

Visual Basic(声明)
Public Overridable Function GetVaryByCustomString ( _
    context As HttpContext, _
    custom As String _
) As String
Visual Basic (用法)
Dim instance As HttpApplication
Dim context As HttpContext
Dim custom As String
Dim returnValue As String

returnValue = instance.GetVaryByCustomString(context, _
    custom)
C#
public virtual string GetVaryByCustomString(
    HttpContext context,
    string custom
)
Visual C++
public:
virtual String^ GetVaryByCustomString(
    HttpContext^ context, 
    String^ custom
)
J#
public String GetVaryByCustomString(
    HttpContext context,
    String custom
)
JScript
public function GetVaryByCustomString(
    context : HttpContext, 
    custom : String
) : String

参数

context
类型:System.Web..::.HttpContext

一个 HttpContext 对象,包含有关当前 Web 请求的信息。

custom
类型:System..::.String

自定义字符串,它指定哪个缓存的响应被用于响应当前请求。

返回值

类型:System..::.String

如果 custom 参数的值为 "browser",则为浏览器的 Type;否则为 nullNothingnullptrnull 引用(在 Visual Basic 中为 Nothing

可以重写 GetVaryByCustomString 以添加一个新方法,该方法计算基于当前请求的自定义变化依据值。此实现必须调用它不能识别的自定义值的基类。有关更多信息,请参见 如何:使用自定义字符串对页的各个版本进行缓存

Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

.NET Framework 和 .NET Compact Framework 并不是对每个平台的所有版本都提供支持。有关支持的版本的列表,请参见.NET Framework 系统要求

.NET Framework

受以下版本支持:3.5、3.0、2.0、1.1、1.0
社区内容   什么是社区内容?
添加新内容 RSS  批注
Processing
© 2009 Microsoft Corporation 版权所有。 保留所有权利  |  商标  |  隐私权声明
Page view tracker