教程集 www.jiaochengji.com
教程集 >  操作系统  >  windows  >  正文 如何获得 Windows 操作系统的版本

如何获得 Windows 操作系统的版本

发布时间:2019-12-12   编辑:jiaochengji.com
教程集为您提供如何获得 Windows 操作系统的版本等资源,欢迎您收藏本站,我们将为您提供最新的如何获得 Windows 操作系统的版本资源
很多时候我们需要知道Windows操作系统的版本,使用下面这个API函数可以做到。
Option Explicit
Private Declare Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long
Private Type OSVERSIONINFO
dwOSVersionInfoSize As Long
dwMajorVersion As Long
dwMinorVersion As Long
dwBuildNumber As Long
dwPlatformId As Long
szCSDVersion As String * 128 ' Maintenance string for PSS usage
osName As String ' 我自己加的, 操作系统的名称
End Type
' 获得 Windows 操作系统的版本
' OSVERSIONINFO 结构中的 osName 返回操作系统的名称
Private Function GetWindowsVersion() As OSVERSIONINFO
Dim ver As OSVERSIONINFO
ver.dwOSVersionInfoSize = 148
GetVersionEx ver
With ver
Select Case .dwPlatformId
Case 1
Select Case .dwMinorVersion
Case 0
.osName = "Windows 95"
Case 10
.osName = "Windows 98"
Case 90
.osName = "Windows Mellinnium"
End Select
Case 2
Select Case .dwMajorVersion
Case 3
.osName = "Windows NT 3.51"
Case 4
.osName = "Windows NT 4.0"
Case 5

您可能感兴趣的文章:
如何获得 Windows 操作系统的版本
C#判断操作系统类型的方法介绍
升级到Windows 8.1后,之前的哪些应用、设置、个人文件能保留
电脑开机蓝屏和系统使用中蓝屏的解决办法
电脑系统在双击EXE文件后无反应,重启或从休眠恢复后输入密码无法登录
ThinkPad笔记本升级Windows 10后Windows.old文件夹删除方法
Windows系统如何打开麦克风(win xp win7 win8 win8.1)
.net入门常见问题
介绍一下Windows CE的学习路线
聊聊,如何快速搭建部署GO开发环境和部署服务?

[关闭]
~ ~