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

Dim instance As ContentType Dim value As String value = instance.MediaType instance.MediaType = value
/** @property */ public String get_MediaType () /** @property */ public void set_MediaType (String value)
メディア タイプおよびサブタイプの値を格納している String。この値には、サブタイプの後にセミコロン (;) の区切り記号は含まれていません。


次に示す Content-Type ヘッダーの例では、MediaType プロパティの値は "application/x-myType" です。
content-type: application/x-myType; name=data.xyz
このプロパティを null 参照 (Visual Basic では Nothing) または String.Empty に設定し、ヘッダーから名前情報を削除します。
Content-Type ヘッダーの構文については、RFC 2045 セクション 5.1 を参照してください。RFC 2046 では、MIME メディア タイプに関する詳細情報が提供されています。これらの RFC については http://www.ietf.org を参照してください。

public static void CreateMessageInlineAttachment2(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); // Send textMessage as part of the e-mail body. message.Attachments.Add(data); ContentType content = data.ContentType; content.MediaType = MediaTypeNames.Text.Plain; //Send the message. // Include credentials if the server requires them. SmtpClient client = new SmtpClient(server); client.Credentials = CredentialCache.DefaultNetworkCredentials; client.Send(message); 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に収録されているすべての辞書からContentType.MediaType プロパティを検索する場合は、下記のリンクをクリックしてください。

- ContentType.MediaType プロパティのページへのリンク