【问题标题】:Windows Forms load on base of WindowsWindows 窗体在 Windows 的基础上加载
【发布时间】:2011-11-13 18:09:53
【问题描述】:

是否可以在窗口基础上加载表单?

if Windows XP load form1
if windows 7 x86 load form2
if windows 7 x64 load form3 

【问题讨论】:

标签: c# winforms visual-studio-2010


【解决方案1】:

是的,使用System.Environment.OSVersion

System.OperatingSystem osInfo = System.Environment.OSVersion

请参阅此 SO 问题以了解如何解释结果:How to translate MS Windows OS version numbers into product names in .NET? 以及此问题:How to detect Windows 64-bit platform with .NET?

然后只需加载适当版本的表单。

【讨论】:

  • 是否可以从 System.Enviroment.OSVersion 获得所有可能的结果?
  • 不,不是。你也必须解决这个问题。这只是几个函数,您可以将它们隐藏在帮助程序类中。
猜你喜欢
  • 2013-07-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-01-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多