Bagikan melalui


HttpRequest.AcceptTypes Properti

Definisi

Mendapatkan array string dari jenis penerimaan MIME yang didukung klien.

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()

Nilai Properti

String[]

Array string dari jenis penerimaan MIME yang didukung klien.

Contoh

Contoh kode berikut mengambil beberapa nilai yang dikembalikan oleh AcceptTypes properti ke dalam variabel objek dan menulis angka dan nama setiap nilai ke baris terpisah output 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
   

Berlaku untuk