Share via


HttpWebRequest.Expect 属性

获取或设置 ExpectHTTP 标头的值。

**命名空间:**System.Net
**程序集:**System(在 system.dll 中)

语法

声明
Public Property Expect As String
用法
Dim instance As HttpWebRequest
Dim value As String

value = instance.Expect

instance.Expect = value
public string Expect { get; set; }
public:
property String^ Expect {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Expect ()

/** @property */
public void set_Expect (String value)
public function get Expect () : String

public function set Expect (value : String)

属性值

ExpectHTTP 标头的内容。默认值为 空引用(在 Visual Basic 中为 Nothing)。

提示

此属性的值存储在 WebHeaderCollection 中。如果设置了 WebHeaderCollection,则该属性值将丢失。

异常

异常类型 条件

ArgumentException

Expect 被设置为一个包含“100-continue”(作为子字符串)的字符串。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

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

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

.NET Compact Framework

受以下版本支持:2.0、1.0

请参见

参考

HttpWebRequest 类
HttpWebRequest 成员
System.Net 命名空间

其他资源

defaultProxy 元素(网络设置)