Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
UserLanguages Property

HttpRequest.UserLanguages Property

Gets a sorted string array of client language preferences.

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

Property Value

A sorted string array of client language preferences.


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

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

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]));

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


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

See Also

HttpRequest Class | HttpRequest Members | System.Web Namespace

© 2015 Microsoft