HttpRequest.AcceptTypes Egenskap

Definition

Hämtar en strängmatris med MIME-accepttyper som stöds av klienten.

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

Egenskapsvärde

String[]

En strängmatris med MIME som stöds av klienten accepterar typer.

Exempel

I följande kodexempel avbildas de flera värden som returneras av AcceptTypes egenskapen till en objektvariabel och skriver numret och namnet på varje värde till en separat rad med HTTP-utdata.

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
   

Gäller för