Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


AlternateView Constructors

Definition

Initializes a new instance of AlternateView.

Overloads

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.

Remarks

A new instance of the AlternateView class call also be initialized by calling one of the CreateAlternateViewFromString methods.

AlternateView(Stream)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified Stream.

C#
public AlternateView (System.IO.Stream contentStream);

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

AlternateView(String)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified file name.

C#
public AlternateView (string fileName);

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

AlternateView(Stream, ContentType)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified Stream and ContentType.

C#
public AlternateView (System.IO.Stream contentStream, System.Net.Mime.ContentType? contentType);
C#
public AlternateView (System.IO.Stream contentStream, System.Net.Mime.ContentType 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

AlternateView(Stream, String)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified Stream and media type.

C#
public AlternateView (System.IO.Stream contentStream, string? mediaType);
C#
public AlternateView (System.IO.Stream contentStream, string mediaType);

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

AlternateView(String, ContentType)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified file name and content type.

C#
public AlternateView (string fileName, System.Net.Mime.ContentType? contentType);
C#
public AlternateView (string fileName, System.Net.Mime.ContentType 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

AlternateView(String, String)

Source:
AlternateView.cs
Source:
AlternateView.cs
Source:
AlternateView.cs

Initializes a new instance of AlternateView with the specified file name and media type.

C#
public AlternateView (string fileName, string? mediaType);
C#
public AlternateView (string fileName, string mediaType);

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