/// Get the operating system language.
///
public static void GetOperatingSystemLanguage()
{
ManagementObjectSearcher objectSearcher = new ManagementObjectSearcher("SELECT * FROM " + "Win32_OperatingSystem");
int languageCode = 0;
foreach (ManagementObject managementObject in objectSearcher.Get())
{
//Create the obect of propertydataCollection and get all the properties
PropertyDataCollection searcherProperties = managementObject.Properties;
foreach (PropertyData propertyData in searcherProperties)
{
string osLanguage = propertyData.Name;
if (osLanguage == STRING_OS_LANGUAGE)
{
if (int.TryParse(propertyData.Value.ToString(), out languageCode))
{
//This is English Laguage Code
if (languageCode == 1033)
{
_systemLanguage = OperatingSystemLanguage.English;
break;
}
//This is German Language Code
else if (languageCode == 1031)
{
_systemLanguage = OperatingSystemLanguage.German;
break;
}
}
}
}
break;
}
}
You can get all the hardware and software properties of OperatingSystem using this.like version number, Physicalmemory,Lastbootuptime.You can know even about processor for the whole project you can contact me at saurabhjnumca@gmail.com.
0 comments:
Post a Comment