ContentDispositionHeaderValue 类

定义

表示 Content-Disposition 标头的值。Represents the value of the Content-Disposition header.

public ref class ContentDispositionHeaderValue : ICloneable
public class ContentDispositionHeaderValue : ICloneable
type ContentDispositionHeaderValue = class
    interface ICloneable
Public Class ContentDispositionHeaderValue
Implements ICloneable
继承
ContentDispositionHeaderValue
实现

注解

内容处置标头通常用于处理文件上传和下载。The Content-Disposition header is normally used for working with file uploads and downloads. 格式与其他标头的不同之处在于,它是一个具有处理类型的单个标头,后跟一个参数列表,其中一些参数定义正确。The format differs from other headers in that it is a single header with a disposition type followed by a list of parameters, some of which are well defined.

此标头用在两个不同的上下文中:This header is used in two different contexts:

  1. MultipartFormDataContent 类中嵌套的正文内容的 MIME 标头。A MIME header for nested body content in the MultipartFormDataContent class. 有关详细信息,请参阅 IETF RFC 2183。For more information, see IETF RFC 2183.

  2. HttpContentHeaders 类中的 HTTP 标头。An HTTP header in HttpContentHeaders class. 有关详细信息,请参阅 IETF RFC 6266。For more information, see IETF RFC 6266.

构造函数

ContentDispositionHeaderValue(ContentDispositionHeaderValue)

初始化 ContentDispositionHeaderValue 类的新实例。Initializes a new instance of the ContentDispositionHeaderValue class.

ContentDispositionHeaderValue(String)

初始化 ContentDispositionHeaderValue 类的新实例。Initializes a new instance of the ContentDispositionHeaderValue class.

属性

CreationDate

创建文件的日期。The date at which the file was created.

DispositionType

内容正文部分的处置类型。The disposition type for a content body part.

FileName

有关如果实体被分离并存储在单独的文件中时,如何构建用于存储要使用的消息有效载荷的文件名的建议。A suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file.

FileNameStar

一条建议,提议在实体被分离并存储在单独文件中时如何构建文件名来存储要使用的消息有效负载。A suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files.

ModificationDate

上次修改文件的日期。The date at which the file was last modified.

Name

内容正文部分的名称。The name for a content body part.

Parameters

一组包含 Content-disposition 标头的参数。A set of parameters included the Content-Disposition header.

ReadDate

上次读取文件的日期。The date the file was last read.

Size

文件的近似大小(以字节为单位)。The approximate size, in bytes, of the file.

方法

Equals(Object)

确定指定的 Object 是否等于当前的 ContentDispositionHeaderValue 对象。Determines whether the specified Object is equal to the current ContentDispositionHeaderValue object.

GetHashCode()

充当 ContentDispositionHeaderValue 对象的哈希函数。Serves as a hash function for an ContentDispositionHeaderValue object.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
Parse(String)

将字符串转换为 ContentDispositionHeaderValue 实例。Converts a string to an ContentDispositionHeaderValue instance.

ToString()

返回表示当前 ContentDispositionHeaderValue 对象的字符串。Returns a string that represents the current ContentDispositionHeaderValue object.

TryParse(String, ContentDispositionHeaderValue)

确定一个字符串是否为有效的 ContentDispositionHeaderValue 信息。Determines whether a string is valid ContentDispositionHeaderValue information.

显式接口实现

ICloneable.Clone()

创建作为当前 ContentDispositionHeaderValue 实例副本的新对象。Creates a new object that is a copy of the current ContentDispositionHeaderValue instance.

适用于