HttpRequest.ContentType HttpRequest.ContentType HttpRequest.ContentType HttpRequest.ContentType Property

定義

取得或設定連入要求的 MIME 內容類型。Gets or sets the MIME content type of the incoming request.

public:
 property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };
public string ContentType { get; set; }
member this.ContentType : string with get, set
Public Property ContentType As String

屬性值

字串,表示收到的要求之 MIME 內容類型,例如 "text/html"。A string representing the MIME content type of the incoming request, for example, "text/html". 其他通用 MIME 類型包括 "audio.wav"、"image/gif" 和 "application/pdf"。Additional common MIME types include "audio.wav", "image/gif", and "application/pdf".

範例

下列程式碼範例會指派給 string 變數代表連入要求的內容類型的值。The following code example assigns the value representing the content type of the incoming request to a string variable.

String str;
 str = Request.ContentType;
   
Dim str As String
 str = Request.ContentType
   

下列範例顯示可能會產生此程式碼的輸出。The following example shows output that might be produced by this code.

GET

127.0.0.1

127.0.0.1

GET

適用於