HttpRequest.AcceptTypes 屬性

定義

取得用戶端支援的 MIME 接受 (Accept) 類型的字串陣列。

public:
 property cli::array <System::String ^> ^ AcceptTypes { cli::array <System::String ^> ^ get(); };
public string[] AcceptTypes { get; }
member this.AcceptTypes : string[]
Public ReadOnly Property AcceptTypes As String()

屬性值

String[]

用戶端支援的 MIME 接受類型的字串陣列。

範例

下列程式碼範例會將 屬性傳 AcceptTypes 回的多個值擷取至物件變數,並將每個值的數目和名稱寫入至個別的 HTTP 輸出行。

int indx;

 String[] arr = Request.AcceptTypes;
 for (indx = 0; indx < arr.Length; indx++) {
    Response.Write("Accept Type " + indx +": " + arr[indx] + "<br>");
 }

Dim MyType() As String
 Dim Indx As Integer
 
 MyType = Request.AcceptTypes
 For Indx = 0 To MyType.GetUpperBound(0)
    Response.Write("Accept Type " & Cstr(Indx) & ": " & Cstr(MyType(Indx)) & "<br>")
 Next Indx
   

適用於