This documentation is archived and is not being maintained.
HttpRequest.AcceptTypes Property
.NET Framework 1.1
Gets a string array of client-supported MIME accept types.
[Visual Basic] Public ReadOnly Property AcceptTypes As String () [C#] public string[] AcceptTypes {get;} [C++] public: __property String* get_AcceptTypes(); [JScript] public function get AcceptTypes() : String[];
Property Value
A string array of client-supported MIME accept types.
Example
The following example captures the multiple values returned by the AcceptTypes property into an object variable and writes the number and name of each AcceptType to a separate line of HTTP output.
[Visual Basic] 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 [C#] int indx; String[] arr = Request.AcceptTypes; for (indx = 0; indx < arr.Length; indx++) { Response.Write("Accept Type " + indx +": " + arr[indx] + "<br>"); } [C++] int indx; String* arr[] = Request->AcceptTypes; for (indx = 0; indx < arr->Length; indx++) { Response->Write(String::Format(S"Accept Type {0}: {1}<br>", __box(indx), arr[indx])); } [JScript] var arr : String[] = Request.AcceptTypes for(var i=0; i < arr.Length; i++){ Response.Write("Accept Type " + i + ": " + arr[i] + "<br>") }
Requirements
Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family
See Also
HttpRequest Class | HttpRequest Members | System.Web Namespace
Show: