HttpRequest.AcceptTypes Proprietà

Definizione

Ottiene una matrice di stringhe di tipi di accettazione MIME supportati dal client.

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

Valore della proprietà

String[]

Matrice di stringhe di tipi di accettazione MIME supportati dal client.

Esempio

L'esempio di codice seguente acquisisce i valori multipli restituiti dalla AcceptTypes proprietà in una variabile oggetto e scrive il numero e il nome di ogni valore in una riga separata di 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
   

Si applica a