⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 一个简单易引用的的读取操作系统版本信息的源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   975
      Left            =   600
      TabIndex        =   0
      Top             =   900
      Width           =   2115
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Command1_Click()
ss = GetVersion
MsgBox ss
End Sub
Public Function GetVersion() As String
   Dim osinfo As OSVERSIONINFO
   Dim retvalue As Integer

   osinfo.dwOSVersionInfoSize = 148
   osinfo.szCSDVersion = Space$(128)
   retvalue = GetVersionExA(osinfo)

   With osinfo
    Select Case .dwPlatformId
        Case 1
                Select Case .dwMinorVersion
                    Case 0
                        GetVersion = "Windows 95"
                    Case 10
                        GetVersion = "Windows 98"
                    Case 90
                        GetVersion = "Windows Mellinnium"
                End Select
        Case 2
                Select Case .dwMajorVersion
                    Case 3
                        GetVersion = "Windows NT 3.51"
                    Case 4
                        GetVersion = "Windows NT 4.0"
                    Case 5
                        If .dwMinorVersion = 0 Then
                            GetVersion = "Windows 2000"
                        Else
                            GetVersion = "Windows XP"
                        End If
                End Select
         Case Else
               GetVersion = "Failed"
    End Select
   End With
End Function

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -