AttachmentBase 构造函数 
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
实例化一个新的 AttachmentBase。
重载
| AttachmentBase(Stream) | 用指定的 AttachmentBase 实例化一个 Stream。 | 
| AttachmentBase(String) | 用指定的文件名实例化一个 AttachmentBase。 | 
| AttachmentBase(Stream, ContentType) | 用指定的 AttachmentBase 和 Stream 实例化一个 ContentType。 | 
| AttachmentBase(Stream, String) | 用指定的 AttachmentBase 和媒体类型实例化一个 Stream。 | 
| AttachmentBase(String, ContentType) | 用指定的文件名和内容类型实例化一个 AttachmentBase。 | 
| AttachmentBase(String, String) | 用指定的文件名和媒体类型实例化一个 AttachmentBase。 | 
AttachmentBase(Stream)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的 AttachmentBase 实例化一个 Stream。
protected:
 AttachmentBase(System::IO::Stream ^ contentStream);protected AttachmentBase (System.IO.Stream contentStream);new System.Net.Mail.AttachmentBase : System.IO.Stream -> System.Net.Mail.AttachmentBaseProtected Sub New (contentStream As Stream)参数
- contentStream
- Stream
一个包含此附件内容的流。
例外
              contentStream 为 null。
适用于
AttachmentBase(String)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的文件名实例化一个 AttachmentBase。
protected:
 AttachmentBase(System::String ^ fileName);protected AttachmentBase (string fileName);new System.Net.Mail.AttachmentBase : string -> System.Net.Mail.AttachmentBaseProtected Sub New (fileName As String)参数
- fileName
- String
保存此附件内容的文件的名称。
例外
              fileName 为 null。
适用于
AttachmentBase(Stream, ContentType)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的 AttachmentBase 和 Stream 实例化一个 ContentType。
protected:
 AttachmentBase(System::IO::Stream ^ contentStream, System::Net::Mime::ContentType ^ contentType);protected AttachmentBase (System.IO.Stream contentStream, System.Net.Mime.ContentType? contentType);protected AttachmentBase (System.IO.Stream contentStream, System.Net.Mime.ContentType contentType);new System.Net.Mail.AttachmentBase : System.IO.Stream * System.Net.Mime.ContentType -> System.Net.Mail.AttachmentBaseProtected Sub New (contentStream As Stream, contentType As ContentType)参数
- contentStream
- Stream
一个包含此附件内容的流。
- contentType
- ContentType
内容的类型。
例外
              contentStream 为 null。
              contentType 不是有效值。
适用于
AttachmentBase(Stream, String)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的 AttachmentBase 和媒体类型实例化一个 Stream。
protected:
 AttachmentBase(System::IO::Stream ^ contentStream, System::String ^ mediaType);protected AttachmentBase (System.IO.Stream contentStream, string? mediaType);protected AttachmentBase (System.IO.Stream contentStream, string mediaType);new System.Net.Mail.AttachmentBase : System.IO.Stream * string -> System.Net.Mail.AttachmentBaseProtected Sub New (contentStream As Stream, mediaType As String)参数
- contentStream
- Stream
一个包含此附件内容的流。
- mediaType
- String
内容的 MIME 媒体类型。
例外
              contentStream 为 null。
              mediaType 不是有效值。
适用于
AttachmentBase(String, ContentType)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的文件名和内容类型实例化一个 AttachmentBase。
protected:
 AttachmentBase(System::String ^ fileName, System::Net::Mime::ContentType ^ contentType);protected AttachmentBase (string fileName, System.Net.Mime.ContentType? contentType);protected AttachmentBase (string fileName, System.Net.Mime.ContentType contentType);new System.Net.Mail.AttachmentBase : string * System.Net.Mime.ContentType -> System.Net.Mail.AttachmentBaseProtected Sub New (fileName As String, contentType As ContentType)参数
- fileName
- String
保存此附件内容的文件的名称。
- contentType
- ContentType
内容的类型。
例外
              fileName 为 null。
              contentType 不是有效值。
适用于
AttachmentBase(String, String)
- Source:
- Attachment.cs
- Source:
- Attachment.cs
- Source:
- Attachment.cs
用指定的文件名和媒体类型实例化一个 AttachmentBase。
protected:
 AttachmentBase(System::String ^ fileName, System::String ^ mediaType);protected AttachmentBase (string fileName, string? mediaType);protected AttachmentBase (string fileName, string mediaType);new System.Net.Mail.AttachmentBase : string * string -> System.Net.Mail.AttachmentBaseProtected Sub New (fileName As String, mediaType As String)参数
- fileName
- String
保存此附件内容的文件的名称。
- mediaType
- String
内容的 MIME 媒体类型。
例外
              fileName 为 null。
              mediaType 不是有效值。