HttpRequest.AcceptTypes HttpRequest.AcceptTypes HttpRequest.AcceptTypes HttpRequest.AcceptTypes Property

定義

取得用戶端支援的 MIME 接受 (Accept) 類型的字串陣列。Gets a string array of client-supported MIME accept types.

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 接受類型的字串陣列。A string array of client-supported MIME accept types.

範例

下列程式碼範例會將AcceptTypes屬性傳回的多個值,捕捉至物件變數,並將每個值的數目和名稱寫入另一行的 HTTP 輸出。The following code example captures the multiple values returned by the AcceptTypes property into an object variable and writes the number and name of each value to a separate line of HTTP output.

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
   

適用於