frmAbout.frm
资源名称:dbbase.rar [点击查看]
上传用户:xiao_xia32
上传日期:2022-07-21
资源大小:1174k
文件大小:10k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
- Begin VB.Form frmAbout
- BorderStyle = 3 'Fixed Dialog
- Caption = "人事管理系统"
- ClientHeight = 3075
- ClientLeft = 3165
- ClientTop = 3210
- ClientWidth = 5940
- ClipControls = 0 'False
- Icon = "frmAbout.frx":0000
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- Moveable = 0 'False
- ScaleHeight = 2122.419
- ScaleMode = 0 'User
- ScaleWidth = 5577.967
- ShowInTaskbar = 0 'False
- Begin Threed.SSCommand cmdOK
- Height = 345
- Left = 4200
- TabIndex = 6
- Top = 1800
- Width = 1500
- _Version = 65536
- _ExtentX = 2646
- _ExtentY = 609
- _StockProps = 78
- Caption = "确 定"
- Font3D = 1
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 495
- Left = 240
- Picture = "frmAbout.frx":0CCA
- ScaleHeight = 495
- ScaleWidth = 495
- TabIndex = 5
- Top = 240
- Width = 495
- End
- Begin Threed.SSCommand cmdSysInfo
- Height = 345
- Left = 4200
- TabIndex = 7
- Top = 2280
- Width = 1500
- _Version = 65536
- _ExtentX = 2646
- _ExtentY = 609
- _StockProps = 78
- Caption = "系统信息(&S)..."
- Font3D = 1
- End
- Begin VB.Label Label1
- Caption = "版权所有:"
- Height = 255
- Left = 2760
- TabIndex = 4
- Top = 1200
- Width = 975
- End
- Begin VB.Line Line1
- BorderColor = &H00808080&
- BorderStyle = 6 'Inside Solid
- Index = 1
- X1 = 112.686
- X2 = 5337.57
- Y1 = 1159.565
- Y2 = 1159.565
- End
- Begin VB.Label lblDescription
- Caption = "海山科技公司"
- ForeColor = &H00000000&
- Height = 330
- Left = 3720
- TabIndex = 0
- Top = 1200
- Width = 3885
- End
- Begin VB.Label lblTitle
- Caption = "人事信息管理"
- BeginProperty Font
- Name = "宋体"
- Size = 12
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 360
- Left = 2760
- TabIndex = 2
- Top = 240
- Width = 3885
- End
- Begin VB.Line Line1
- BorderColor = &H00FFFFFF&
- BorderWidth = 2
- Index = 0
- X1 = 112.686
- X2 = 5323.484
- Y1 = 1159.565
- Y2 = 1159.565
- End
- Begin VB.Label lblVersion
- Caption = "版本 V 1.0.1"
- Height = 225
- Left = 2760
- TabIndex = 3
- Top = 720
- Width = 3885
- End
- Begin VB.Label lblDisclaimer
- Caption = $"frmAbout.frx":0FD4
- ForeColor = &H00000000&
- Height = 1065
- Left = 240
- TabIndex = 1
- Top = 1800
- Width = 3870
- End
- End
- Attribute VB_Name = "frmAbout"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- ' 注册表关键字安全选项...
- Const READ_CONTROL = &H20000
- Const KEY_QUERY_VALUE = &H1
- Const KEY_SET_VALUE = &H2
- Const KEY_CREATE_SUB_KEY = &H4
- Const KEY_ENUMERATE_SUB_KEYS = &H8
- Const KEY_NOTIFY = &H10
- Const KEY_CREATE_LINK = &H20
- Const KEY_ALL_ACCESS = KEY_QUERY_VALUE + KEY_SET_VALUE + _
- KEY_CREATE_SUB_KEY + KEY_ENUMERATE_SUB_KEYS + _
- KEY_NOTIFY + KEY_CREATE_LINK + READ_CONTROL
- ' 注册表关键字 ROOT 类型...
- Const HKEY_LOCAL_MACHINE = &H80000002
- Const ERROR_SUCCESS = 0
- Const REG_SZ = 1 ' 独立的空的终结字符串
- Const REG_DWORD = 4 ' 32位数字
- Const gREGKEYSYSINFOLOC = "SOFTWAREMicrosoftShared Tools Location"
- Const gREGVALSYSINFOLOC = "MSINFO"
- Const gREGKEYSYSINFO = "SOFTWAREMicrosoftShared ToolsMSINFO"
- Const gREGVALSYSINFO = "PATH"
- Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, ByRef phkResult As Long) As Long
- Private Declare Function RegQueryValueEx Lib "advapi32" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, ByRef lpType As Long, ByVal lpData As String, ByRef lpcbData As Long) As Long
- Private Declare Function RegCloseKey Lib "advapi32" (ByVal hKey As Long) As Long
- Private Sub cmdSysInfo_Click()
- Call StartSysInfo
- End Sub
- Private Sub cmdOK_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Me.Caption = "人事信息管理系统"
- lblVersion.Caption = "版本 " & App.Major & "." & App.Minor & "." & App.Revision
- lblTitle.Caption = "人事信息管理系统"
- End Sub
- Public Sub StartSysInfo()
- On Error GoTo SysInfoErr
- Dim rc As Long
- Dim SysInfoPath As String
- ' 试图从注册表中获得系统信息程序的路径及名称...
- If GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFO, gREGVALSYSINFO, SysInfoPath) Then
- ' 试图仅从注册表中获得系统信息程序的路径...
- ElseIf GetKeyValue(HKEY_LOCAL_MACHINE, gREGKEYSYSINFOLOC, gREGVALSYSINFOLOC, SysInfoPath) Then
- ' 已知32位文件版本的有效位置
- If (Dir(SysInfoPath & "MSINFO32.EXE") <> "") Then
- SysInfoPath = SysInfoPath & "MSINFO32.EXE"
- ' 错误 - 文件不能被找到...
- Else
- GoTo SysInfoErr
- End If
- ' 错误 - 注册表相应条目不能被找到...
- Else
- GoTo SysInfoErr
- End If
- Call Shell(SysInfoPath, vbNormalFocus)
- Exit Sub
- SysInfoErr:
- MsgBox "此时系统信息不可用", vbOKOnly
- End Sub
- Public Function GetKeyValue(KeyRoot As Long, KeyName As String, SubKeyRef As String, ByRef KeyVal As String) As Boolean
- Dim i As Long ' 循环计数器
- Dim rc As Long ' 返回代码
- Dim hKey As Long ' 打开的注册表关键字句柄
- Dim hDepth As Long '
- Dim KeyValType As Long ' 注册表关键字数据类型
- Dim tmpVal As String ' 注册表关键字值的临时存储器
- Dim KeyValSize As Long ' 注册表关键自变量的尺寸
- '------------------------------------------------------------
- ' 打开 {HKEY_LOCAL_MACHINE...} 下的 RegKey
- '------------------------------------------------------------
- rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_ALL_ACCESS, hKey) ' 打开注册表关键字
- If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' 处理错误...
- tmpVal = String$(1024, 0) ' 分配变量空间
- KeyValSize = 1024 ' 标记变量尺寸
- '------------------------------------------------------------
- ' 检索注册表关键字的值...
- '------------------------------------------------------------
- rc = RegQueryValueEx(hKey, SubKeyRef, 0, _
- KeyValType, tmpVal, KeyValSize) ' 获得/创建关键字值
- If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' 处理错误
- If (Asc(Mid(tmpVal, KeyValSize, 1)) = 0) Then ' Win95 外接程序空终结字符串...
- tmpVal = Left(tmpVal, KeyValSize - 1) ' Null 被找到,从字符串中分离出来
- Else ' WinNT 没有空终结字符串...
- tmpVal = Left(tmpVal, KeyValSize) ' Null 没有被找到, 分离字符串
- End If
- '------------------------------------------------------------
- ' 决定转换的关键字的值类型...
- '------------------------------------------------------------
- Select Case KeyValType ' 搜索数据类型...
- Case REG_SZ ' 字符串注册关键字数据类型
- KeyVal = tmpVal ' 复制字符串的值
- Case REG_DWORD ' 四字节的注册表关键字数据类型
- For i = Len(tmpVal) To 1 Step -1 ' 将每位进行转换
- KeyVal = KeyVal + Hex(Asc(Mid(tmpVal, i, 1))) ' 生成值字符。 By Char。
- Next
- KeyVal = Format$("&h" + KeyVal) ' 转换四字节的字符为字符串
- End Select
- GetKeyValue = True ' 返回成功
- rc = RegCloseKey(hKey) ' 关闭注册表关键字
- Exit Function ' 退出
- GetKeyError: ' 错误发生后将其清除...
- KeyVal = "" ' 设置返回值到空字符串
- GetKeyValue = False ' 返回失败
- rc = RegCloseKey(hKey) ' 关闭注册表关键字
- End Function