随笔 - 224  文章 - 41  trackbacks - 0
<2010年4月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

享受编程

常用链接

留言簿(11)

随笔分类(159)

随笔档案(224)

文章分类(2)

文章档案(4)

经典c++博客

搜索

  •  

最新评论

阅读排行榜

评论排行榜

原文地址:http://www.cnblogs.com/cyrix/articles/1708533.html
 
/// <summary>
       
/// Gets a value indicating if the process is running in 64 bit environment.
       
/// </summary>
        public static unsafe bool IsRunningOn64Bit
        {
           
get { return (sizeof(IntPtr) == sizeof(long)); }
        }

       
/// <summary>
       
/// Gets a value indicating if the operating system is a Windows 2000 or a newer one.
       
/// </summary>
        public static bool IsWindows2000OrNewer
        {
           
get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major >= 5); }
        }

       
/// <summary>
       
/// Gets a value indicating if the operating system is a Windows XP or a newer one.
       
/// </summary>
        public static bool IsWindowsXpOrNewer
        {
           
get
            {
               
return
                    (Environment.OSVersion.Platform
== PlatformID.Win32NT) &&
                    (
                        (Environment.OSVersion.Version.Major
>= 6) ||
                        (
                            (Environment.OSVersion.Version.Major
== 5) &&
                            (Environment.OSVersion.Version.Minor
>= 1)
                        )
                    );
            }
        }

       
/// <summary>
       
/// Gets a value indicating if the operating system is a Windows Vista or a newer one.
       
/// </summary>
        public static bool IsWindowsVistaOrNewer
        {
           
get { return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major >= 6); }
        }





编译项目:“可编译不安全代码”属性设置为true

方法如下:项目属性对话框
->配置属性->生成->允许不安全代码块 设为"true\"
posted on 2010-08-27 11:52 漂漂 阅读(742) 评论(0)  编辑 收藏 引用 所属分类: c#开发

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理