System.Web Namespace HttpRequest Class
Gets a string array of client-supported MIME accept types.
[ VB ]
Public ReadOnly Property AcceptTypes As String ( )
[ C# ]
public string [ ] AcceptTypes {get;}
[ C++ ]
public: __property String* get_AcceptTypes ( );
[ JScript ]
public function get AcceptTypes ( ) : String [ ];
A string array of client-supported MIME accept types.
The following example captures the value ( s ) returned by the AcceptTypes property into a string array and writes the index and name of each AcceptType to a separate line of HTTP output.
<script language="C#" runat="server">
string html;
void Page_Load ( ) {
int i;
String [ ] arr = Request.AcceptTypes;
for ( i = 0; i < arr.Length; i++ ) {
html += "Accept Type " + i + ": " + arr [ i ] + "<br>";
}
}
</script>
<script language="VB" runat="server">
Dim html as string
sub Page_Load ( ) {
Dim i as Integer
Dim arr ( ) as String = Request.AcceptTypes
For i = 0 To arr.GetUpperBound ( 0 )
html = html & "Accept Type " & Cstr ( i ) & ": " & Cstr ( arr ( i ) ) & "<br>"
Next i
end sub
</script> |
|
C# |
VB |
Show me
HttpRequest Members