一、獲得操作系統版本號:System.Environment.OSVersion.Version
二、在系統“關於”中設置 的“設備標識”
private string GetDeviceName()
{
return System.Net.Dns.GetHostName();//ppc or smtphone
}
或者
public static string MachineName
{
get
{
string machineName = "";
try
{
RegistryKey ident = Registry.LocalMachine.OpenSubKey("Ident");
machineName = ident.GetValue("Name").ToString();
ident.Close();
}
catch
{
throw new PlatformNotSupportedException();
}
return machineName;
}
}
三、獲得設備型號
/// <summary>
/// 獲得 OEM 信息. 為設備型號
/// </summary>
public static string OemInfo
{
get
{
StringBuilder oemInfo = new StringBuilder(50);
if(SystemParametersInfo4Strings((uint)SystemParametersInfoActions.GetOemInfo, (uint)oemInfo.Capacity, oemInfo,0) == 0)
{
throw new Exception("Retrieving OEM info failed");
}
return oemInfo.ToString();
}
}