ContentType.Parameters プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > ContentType.Parameters プロパティの意味・解説 

ContentType.Parameters プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

このインスタンス表される Content-Type ヘッダー内に含まれるパラメータ格納しているディクショナリを取得します

名前空間: System.Net.Mime
アセンブリ: System (system.dll 内)
構文構文

Public ReadOnly Property
 Parameters As StringDictionary
Dim instance As ContentType
Dim value As StringDictionary

value = instance.Parameters
public StringDictionary Parameters { get; }
public:
property StringDictionary^ Parameters {
    StringDictionary^ get ();
}
/** @property */
public StringDictionary get_Parameters ()
public function get Parameters
 () : StringDictionary

プロパティ
名前と値のペア格納している書き込み可能な StringDictionary。

解説解説

ContentType オブジェクトの作成時に、Content-Header のすべての値を指定してこのパラメータ設定できますまた、Parameters プロパティによって返される StringDictionaryパラメータ追加することもできます

パラメータのエントリをディクショナリに追加する場合は、パラメータの名前がそのエントリのキーで、パラメータの値がそのエントリの値です。

Content-Type ヘッダー構文詳細は、RFC 2045 セクション 5.1記述されています。RFC 2046 では、MIME メディア タイプとそれらに関連付けられたパラメータに関する詳細情報提供されています。これらの RFC については http://www.ietf.org を参照してください

使用例使用例

このプロパティによって返されるディクショナリ内の値を表示するコード例次に示します

public static void CreateMessageWithMultipleViews(string
 server, string recipients)
{
    // Create a message and set up the recipients.
    MailMessage message = new MailMessage(
        "jane@contoso.com",
        recipients,
        "This e-mail message has multiple views.",
        "This is some plain text.");

    // Construct the alternate body as HTML.
    string body = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD
 HTML 4.0 Transitional//EN\">";
    body += "<HTML><HEAD><META http-equiv=Content-Type content=\"text/html;
 charset=iso-8859-1\">";
    body += "</HEAD><BODY><DIV><FONT face=Arial color=#ff0000
 size=2>this is some HTML text";
    body += "</FONT></DIV></BODY></HTML>";

    // Add the alternate body to the message.
    AlternateView alternate = new AlternateView(body, MediaTypeNames.Text.Html);
    message.AlternateViews.Add(alternate);

    // Send the message.
    SmtpClient client = new SmtpClient(server);
    client.Credentials = CredentialCache.DefaultNetworkCredentials;
    client.Send(message);
    // Display the values in the ContentType for the attachment.
    ContentType c = alternate.ContentType;
    Console.WriteLine("Content type");
    Console.WriteLine(c.ToString());
    Console.WriteLine("Boundary {0}", c.Boundary);
    Console.WriteLine("CharSet {0}", c.CharSet);
    Console.WriteLine("MediaType {0}", c.MediaType);
    Console.WriteLine("Name {0}", c.Name);
    Console.WriteLine("Parameters: {0}", c.Parameters.Count);
    foreach (DictionaryEntry d in c.Parameters)
    {
        Console.WriteLine("{0} = {1}", d.Key, d.Value);
    }
    Console.WriteLine();
    alternate.Dispose();
}

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からContentType.Parameters プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からContentType.Parameters プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からContentType.Parameters プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

ContentType.Parameters プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



ContentType.Parameters プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS