zoukankan      html  css  js  c++  java
  • c#获取系统语言及版本信息

    //当前操作系统是否为简体中文
    public static bool IsChineseSimple(){
       return System.Threading.Thread.CurrentThread.CurrentCulture.Name == "zh-CN";
    }

    //当前操作系统是否为繁体中文
    public static bool IsChineseTW()
    {
        return System.Threading.Thread.CurrentThread.CurrentCulture.Name == "Zh-TW";
    }

    //当前操作系统是否为英语(美国)
    public static bool IsEnglish()
    {
        return System.Threading.Thread.CurrentThread.CurrentCulture.Name == "en-US";
    }

    //当前操作系统是否为日语
    public static bool IsJapan()
    {
        return System.Threading.Thread.CurrentThread.CurrentCulture.Name == "ja-JP";
    }

    ------------------------------------------------------------------------------

    //C#判断操作系统是否为Windows98
    public static bool IsWindows98
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() != "2222A");
        }
    }
    //C#判断操作系统是否为Windows98第二版
    public static bool IsWindows98Second
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32Windows) && (Environment.OSVersion.Version.Minor == 10) && (Environment.OSVersion.Version.Revision.ToString() == "2222A");
        }
    }
    //C#判断操作系统是否为Windows2000
    public static bool IsWindows2000
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 0);
        }
    }
    //C#判断操作系统是否为WindowsXP
    public static bool IsWindowsXP { 
        get {
            return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 1); 
        } 
    }
    //C#判断操作系统是否为Windows2003
    public static bool IsWindows2003
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 5) && (Environment.OSVersion.Version.Minor == 2);
        }
    }
    //C#判断操作系统是否为WindowsVista
    public static bool IsWindowsVista
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 0);
        }
    }
    //C#判断操作系统是否为Windows7
    public static bool IsWindows7
    {
        get
        {
            return (Environment.OSVersion.Platform == PlatformID.Win32NT) && (Environment.OSVersion.Version.Major == 6) && (Environment.OSVersion.Version.Minor == 1);
        }
    }
    //C#判断操作系统是否为Unix
    public static bool IsUnix
    {
        get
        {
            return Environment.OSVersion.Platform == PlatformID.Unix;
        }
    }
  • 相关阅读:
    使用Ruby On Rails建立一个山寨小说站(一)
    sql server 数据库备份概述
    JVM崩溃的原因及解决!
    C++中的字节对齐
    jqueyr用jsonp跨越,有服务器端代码(.net(C#语言))
    lammps_data文件
    jquery日历插件_时间范围_双日历_多日历
    js 判断所选时间(或者当前时间)是否在某一时间段
    webstorm安装时遇到The JVM could not be started的解决方法
    Webstorm快捷键
  • 原文地址:https://www.cnblogs.com/zengpeng/p/2790432.html
Copyright © 2011-2022 走看看