System.Web Namespace HttpRequest Class
Gets a sorted string array of client language preferences.
[ VB ]
Public ReadOnly Property UserLanguages As String ( )
[ C# ]
public string [ ] UserLanguages {get;}
[ C++ ]
public: __property String* get_UserLanguages ( );
[ JScript ]
public function get UserLanguages ( ) : String [ ];
A sorted string array of client language preferences.
The following example captures the value ( s ) returned by the UserLanguages property into a string array then writes each individual user language name to a separate line of HTTP output.
<script language="C#" runat="server">
string html;
void Page_Load ( ) {
int i;
String [ ] arr = Request.UserLanguages;
for ( i = 0; i < arr.Length; i++ ) {
html += "User Language " + 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.UserLanguages
For i = 0 To arr.GetUpperBound ( 0 )
html = html & "User Language " & Cstr ( i ) & ": " & Cstr ( arr ( i ) ) & "<br>"
Next i
end sub
</script> |
|
C# |
VB |
Show me
HttpRequest Members