boardType(0)
Select Case KbType
Case 1
KeyType="IBM PC\XT,or compatible"
Case 2
KeyType="Olivetti ''ICO''(102key)"
Case 3
KeyType="IBM AT/similar(84keys)"
Case 4
KeyType = "IBM Enhance(101/102 keys)"
Case 5
KeyType = "Nokia1050/similar"
Case 6
KeyType = "Nokia9140/similar"
Case 7
KeyType = "Japan Keyboard"
End Select
End Function
3.检测Windows版本号函数
Function WinVer()
ver& = GetVersion()
winhigh = ver& Mod 256
winlow = Int(ver& / 256) Mod 256
WinVer = ((winhigh * 100) + winlow) / 100
End Function
4.检测系统CPU函数
Function CPU()
Flags&=GetWinFlags()
Match=1
Select Case Match
Case (Flags& And &H8)\&H8
CPU=486
Case (Flags& And &H4)\&H4
CPU=386
End Select
End Function
5.检测Windows运行模式函数
Function Mode()
Flags&=GetWinFlags()
If flags& And &H20 Then
Mode="Enhanced"
Else
Mode="Standard"
End If
End Function
(二) 建 立 窗 体 文 件Form1.frm
Form1.Caption="System Information"
Sub Form_Load()
Cls
Print
Print , "System Information"
Print
Print , "WindowsDir: ", WinDir()
Print , "KeyboardType: ", KeyType()
Print , "WindowsVersion: ", WinVer()
Print , "SystemCpu: ", CPU()
Print , "WindowsMode: ", Mode()
End Sub
在Visual Basic中用 Declare语句声明所要调用的Windows API函数, 使得程序设计者在Visual Basic中能够直接控制和处理
计算机的系统参数和硬件资源,增加了
程序设计者在Windows环境中开发软件的灵活性,使软件与Windows系统达到了最完美的结合。