ContentDisposition 构造函数

定义

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

重载

ContentDisposition()

AttachmentDispositionType 初始化 ContentDisposition 类的新实例。Initializes a new instance of the ContentDisposition class with a DispositionType of Attachment.

ContentDisposition(String)

使用指定的处置信息初始化 ContentDisposition 类的新实例。Initializes a new instance of the ContentDisposition class with the specified disposition information.

ContentDisposition()

AttachmentDispositionType 初始化 ContentDisposition 类的新实例。Initializes a new instance of the ContentDisposition class with a DispositionType of Attachment.

public:
 ContentDisposition();
public ContentDisposition ();
Public Sub New ()

示例

下面的代码示例演示如何调用此构造函数。The following code example demonstrates how to call this constructor.

ContentDisposition^ c1 = gcnew ContentDisposition;
Console::WriteLine( c1 );

ContentDisposition c1 = new ContentDisposition();
Console.WriteLine(c1.ToString());

注解

此构造函数返回的实例的 DispositionType 属性已设置为 AttachmentThe instance returned by this constructor has the DispositionType property set to Attachment.

适用于

ContentDisposition(String)

使用指定的处置信息初始化 ContentDisposition 类的新实例。Initializes a new instance of the ContentDisposition class with the specified disposition information.

public:
 ContentDisposition(System::String ^ disposition);
public ContentDisposition (string disposition);
new System.Net.Mime.ContentDisposition : string -> System.Net.Mime.ContentDisposition
Public Sub New (disposition As String)

参数

disposition
String

包含处置方式的 DispositionTypeNames 值。A DispositionTypeNames value that contains the disposition.

例外

dispositionnull 或等于 Empty ("")。disposition is null or equal to Empty ("").

示例

下面的代码示例演示如何调用此构造函数。The following code example demonstrates how to call this constructor.

ContentDisposition^ c2 = gcnew ContentDisposition( L"attachment" );
Console::WriteLine( c2 );

ContentDisposition c2 = new ContentDisposition("attachment");
Console.WriteLine(c2.ToString());

适用于