private OperatingSystem os = System.Environment.OSVersion; os.Version.Major.ToString(); if(gOSv.Version.Major >= 6) { //Win7系统 }