Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

HttpRequest.UserLanguages Property

Gets a sorted string array of client language preferences.

[Visual Basic]
Public ReadOnly Property UserLanguages As String ()
[C#]
public string[] UserLanguages {get;}
[C++]
public: __property String* get_UserLanguages();
[JScript]
public function get UserLanguages() : String[];

Property Value

A sorted string array of client language preferences.

Example

The following example captures the multiple values returned by the UserLanguages property into a string array then writes each individual user language name to a separate line of HTTP output.

[Visual Basic] 
Dim userLang() As String
 Dim count As Integer
 
 userLang = Request.UserLanguages
 For count = 0 To userLang.GetUpperBound(0)
    Response.Write("User Language: " & Cstr(userLang(count)) & "<br>")
 Next count
   

[C#] 
int count;
String[] userLang = Request.UserLanguages;    
 
for (count = 0; count < userLang.Length; count++) 
{
   Response.Write("User Language " + count +": " + userLang[count] + "<br>");
}
   

[C++] 
int count;
String* userLang[] = Request->UserLanguages;    
 
for (count = 0; count < userLang->Length; count++) 
{
   Response->Write(String::Format(S"User Language {0}: {1}<br>", __box(count), userLang[count]));
}
   

[JScript] 
var userLang : String[] = Request.UserLanguages
for(var count=0; count < userLang.Length; count++){
  Response.Write("User Language: " + userLang[count] + "<br>")
}

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.