MailAttachment クラス
アセンブリ: System.Web (system.web.dll 内)

<ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202")> _ Public Class MailAttachment
[ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202")] public class MailAttachment
[ObsoleteAttribute(L"The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202")] public ref class MailAttachment
/** @attribute ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202") */ public class MailAttachment
ObsoleteAttribute("The recommended alternative is System.Net.Mail.Attachment. http://go.microsoft.com/fwlink/?linkid=14202") public class MailAttachment

System.Web.Mail.MailAttachment


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MailAttachment コンストラクタ (String)
アセンブリ: System.Web (system.web.dll 内)



'This example shows how to programmatically add attachments 'to a mail lessage. Dim MyMail As MailMessage = New MailMessage() Dim iLoop1 As integer ' Concatenate a list of attachment files in a string. Dim sAttach As String = "C:\images\image1.jpg,C:\images\image2.jpg,C:\images\image3.jpg" ' Build an IList of mail attachments using the files named in the string. Dim delim As Char = " ," Dim sSubstr As String For Each sSubstr in sAttach.Split(delim) Dim myAttachment As MailAttachment = New MailAttachment(sSubstr) myMail.Attachments.Add(myAttachment) Next
//This example shows how to programmatically add attached files //to a mail lessage. MailMessage myMail = new MailMessage(); // Concatenate a list of attachment files in a string. string sAttach = @"C:\images\image1.jpg,C:\images\image2.jpg ,C:\images\image3.jpg"; // Build an IList of mail attachments using the files named in the string. char[] delim = new char[] {','}; foreach (string sSubstr in sAttach.Split(delim)) { MailAttachment myAttachment = new MailAttachment(sSubstr); myMail.Attachments.Add(myAttachment); }
//This example shows how to programmatically add attached files //to a mail lessage. MailMessage myMail = new MailMessage(); // Concatenate a list of attachment files in a string. String sAttach = "C:\\images\\image1.jpg,C:\\images\\image2.jpg," + "C:\\images\\image3.jpg"; // Build an IList of mail attachments using the files named // in the string. char delim[] = new char[] { ',' }; for (int iCtr = 0; iCtr < sAttach.Split(delim).get_Length(); iCtr++) { String sSubstr = sAttach.Split(delim)[iCtr]; MailAttachment myAttachment = new MailAttachment(sSubstr); myMail.get_Attachments().Add(myAttachment); }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MailAttachment コンストラクタ

名前 | 説明 |
---|---|
MailAttachment (String) | 添付ファイルの名前を指定して、MailAttachment クラスの新しいインスタンスを初期化します。既定では、Encoding プロパティは UUEncode に設定されます。推奨する代替 : System.Net.Mail. |
MailAttachment (String, MailEncoding) | 添付ファイルの名前とエンコーディングの種類を指定して、MailAttachment クラスの新しいインスタンスを初期化します。推奨する代替 : System.Net.Mail |

MailAttachment コンストラクタ (String, MailEncoding)
アセンブリ: System.Web (system.web.dll 内)

Dim filename As String Dim encoding As MailEncoding Dim instance As New MailAttachment(filename, encoding)

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


MailAttachment プロパティ

名前 | 説明 | |
---|---|---|
![]() | Encoding | 電子メールの添付ファイルのエンコーディングの種類を取得します。推奨する代替 : System.Net.Mail |
![]() | Filename | 添付ファイルの名前を取得します。推奨する代替 : System.Net.Mail |

MailAttachment メソッド

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 ( Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

MailAttachment メンバ
電子メールの添付ファイルを作成するために使用するプロパティとメソッドを提供します。推奨する代替 : System.Net.Mail
MailAttachment データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | Encoding | 電子メールの添付ファイルのエンコーディングの種類を取得します。推奨する代替 : System.Net.Mail |
![]() | Filename | 添付ファイルの名前を取得します。推奨する代替 : System.Net.Mail |

名前 | 説明 | |
---|---|---|
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | Finalize | Object がガベージ コレクションにより収集される前に、その Object がリソースを解放し、その他のクリーンアップ操作を実行できるようにします。 (Object から継承されます。) |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

- MailAttachmentのページへのリンク