Steps Involved:
· Open Visual Studio 2010.
· Go to File => New => Project.
· Select Console Application Template from the installed templates.
· Enter the name and click on Ok.
· Add the following assembly.
o Microsoft.SharePoint.dll
· Add the following Namespace.
o Using Microsoft.SharePoint;
· Replace Program.cs with the following code.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; namespace Languages { classProgram { staticvoid Main(string[] args) { using (SPSite site = newSPSite("http://serverName:22222/sites/Test/")) { using (SPWeb web = site.RootWeb) { SPLanguageCollection installedLanguages = web.RegionalSettings.InstalledLanguages; foreach (SPLanguage language in installedLanguages) { Console.WriteLine("Name: {0}, LCID:{1}", language.DisplayName, language.LCID); } Console.ReadLine(); } } } } } |
· Build the solution.
· Hit F5.
