Attachment.ContentDisposition プロパティ
アセンブリ: System (system.dll 内)

この添付データの表示形式の情報を指定する ContentDisposition。

ContentDisposition クラスの情報は、MIME の Content-Disposition ヘッダーを表します。このヘッダーは、RFC 2183 (http://www.ietf.org を参照) に記述されています。

添付データの ContentDisposition を取得してそのプロパティを表示するコード例を次に示します。
public static void CreateMessageAttachment1(string server, string textMessage) { // Create a message and set up the recipients. MailMessage message = new MailMessage( "jane@contoso.com", "ben@contoso.com", "A text message for you.", "Message: "); // Attach the message string to this e-mail message. Attachment data = new Attachment(textMessage, MediaTypeNames.Text.Plain); ContentDisposition disposition = data.ContentDisposition; // Suggest a file name for the attachment. disposition.FileName = "message" + DateTime.Now.ToString(); message.Attachments.Add(data); //Send the message. SmtpClient client = new SmtpClient(server); client.Credentials = CredentialCache.DefaultNetworkCredentials; client.Send(message); // Display the values in the ContentDisposition for the attachment. Console.WriteLine("Content disposition"); Console.WriteLine(disposition.ToString()); Console.WriteLine("File {0}", disposition.FileName); Console.WriteLine("Size {0}", disposition.Size); Console.WriteLine("Creation {0}", disposition.CreationDate); Console.WriteLine("Modification {0}", disposition.ModificationDate); Console.WriteLine("Read {0}", disposition.ReadDate); Console.WriteLine("Inline {0}", disposition.Inline); Console.WriteLine("Parameters: {0}", disposition.Parameters.Count); foreach (DictionaryEntry d in disposition.Parameters) { Console.WriteLine("{0} = {1}", d.Key, d.Value); } data.Dispose(); }

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


Weblioに収録されているすべての辞書からAttachment.ContentDisposition プロパティを検索する場合は、下記のリンクをクリックしてください。

- Attachment.ContentDisposition プロパティのページへのリンク