HttpRequest.AcceptTypes 属性

定义

获取客户端支持的 MIME 接受类型的字符串数组。

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
   

适用于