AlternateView Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of AlternateView.
AlternateView(Stream) |
Initializes a new instance of AlternateView with the specified Stream. |
AlternateView(String) |
Initializes a new instance of AlternateView with the specified file name. |
AlternateView(Stream, ContentType) |
Initializes a new instance of AlternateView with the specified Stream and ContentType. |
AlternateView(Stream, String) |
Initializes a new instance of AlternateView with the specified Stream and media type. |
AlternateView(String, ContentType) |
Initializes a new instance of AlternateView with the specified file name and content type. |
AlternateView(String, String) |
Initializes a new instance of AlternateView with the specified file name and media type. |
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified Stream.
public:
AlternateView(System::IO::Stream ^ contentStream);
public AlternateView (System.IO.Stream contentStream);
new System.Net.Mail.AlternateView : System.IO.Stream -> System.Net.Mail.AlternateView
Public Sub New (contentStream As Stream)
Parameters
- contentStream
- Stream
A stream that contains the content for this view.
Exceptions
contentStream
is null
.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified file name.
public:
AlternateView(System::String ^ fileName);
public AlternateView (string fileName);
new System.Net.Mail.AlternateView : string -> System.Net.Mail.AlternateView
Public Sub New (fileName As String)
Parameters
- fileName
- String
The name of the file that contains the content for this alternate view.
Exceptions
fileName
is null
.
The caller does not have the required permission.
An I/O error occurred, such as a disk error.
The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified Stream and ContentType.
public:
AlternateView(System::IO::Stream ^ contentStream, System::Net::Mime::ContentType ^ contentType);
public AlternateView (System.IO.Stream contentStream, System.Net.Mime.ContentType? contentType);
public AlternateView (System.IO.Stream contentStream, System.Net.Mime.ContentType contentType);
new System.Net.Mail.AlternateView : System.IO.Stream * System.Net.Mime.ContentType -> System.Net.Mail.AlternateView
Public Sub New (contentStream As Stream, contentType As ContentType)
Parameters
- contentStream
- Stream
A stream that contains the content for this attachment.
- contentType
- ContentType
The type of the content.
Exceptions
contentStream
is null
.
contentType
is not a valid value.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified Stream and media type.
public:
AlternateView(System::IO::Stream ^ contentStream, System::String ^ mediaType);
public AlternateView (System.IO.Stream contentStream, string? mediaType);
public AlternateView (System.IO.Stream contentStream, string mediaType);
new System.Net.Mail.AlternateView : System.IO.Stream * string -> System.Net.Mail.AlternateView
Public Sub New (contentStream As Stream, mediaType As String)
Parameters
- contentStream
- Stream
A stream that contains the content for this attachment.
- mediaType
- String
The MIME media type of the content.
Exceptions
contentStream
is null
.
mediaType
is not a valid value.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified file name and content type.
public:
AlternateView(System::String ^ fileName, System::Net::Mime::ContentType ^ contentType);
public AlternateView (string fileName, System.Net.Mime.ContentType? contentType);
public AlternateView (string fileName, System.Net.Mime.ContentType contentType);
new System.Net.Mail.AlternateView : string * System.Net.Mime.ContentType -> System.Net.Mail.AlternateView
Public Sub New (fileName As String, contentType As ContentType)
Parameters
- fileName
- String
The name of the file that contains the content for this alternate view.
- contentType
- ContentType
The type of the content.
Exceptions
fileName
is null
.
contentType
is not a valid value.
The caller does not have the required permission.
An I/O error occurred, such as a disk error.
The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
- Source:
- AlternateView.cs
Initializes a new instance of AlternateView with the specified file name and media type.
public:
AlternateView(System::String ^ fileName, System::String ^ mediaType);
public AlternateView (string fileName, string? mediaType);
public AlternateView (string fileName, string mediaType);
new System.Net.Mail.AlternateView : string * string -> System.Net.Mail.AlternateView
Public Sub New (fileName As String, mediaType As String)
Parameters
- fileName
- String
The name of the file that contains the content for this alternate view.
- mediaType
- String
The MIME media type of the content.
Exceptions
fileName
is null
.
mediaType
is not a valid value.
The caller does not have the required permission.
An I/O error occurred, such as a disk error.
The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access.
Remarks
A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.
Applies to
.NET 9 és más verziók
Termék | Verziók |
---|---|
.NET | Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 2.0, 2.1 |
.NET-visszajelzés
A(z) .NET egy nyílt forráskód projekt. Visszajelzés adásához válasszon egy hivatkozást: