取得作業系統資訊:
屬性 | 說明 | 範例 (Me) | 範例 (NT) |
ComputerName | 取得電腦名稱 | Tsengwen | Feitsui |
UserName | 取得登入電腦的使用者名稱 | tsengwen | Devil |
OSVersion | 作業系統版本字串 | Windows Me | Windows NT |
OSPlatform | 作業系統版本類別 | 1 | 2 |
OSMajorVersion | 作業系統主版號 | 4 | 4 |
OSMinorVersion | 作業系統次版號 | 90 | 0 |
OSReleaseVersion | 作業系統終版號 | 3000 | 1381 |
OSBuildNumber | 作業系統建立版號 | 1114 | 0 |
OSDescriptionVersion | 作業系統版本描述字串 | Service Pack 5 |
使用範例:
Public SysInfo As New cSysInfomation
Private Sub Form_Load()
' [略]
With SysInfo
lblPlatform.Caption = .OSVersion + " Ver. " + CStr(.OSMajorVersion) + "." + CStr(.OSMinorVersion)
End WithEnd Sub
其它說明:
OSPlatform:
值 | 意義 | 代表作業系統 |
0 | Win16 | Windows 3.x |
1 | Win32 | Windows 9x |
2 | WinNT | Windows NT |
OSMinorVersion:Windows 95, Windows 98, Windows 98 SE, Windows Me 可以利用次版號及終版號判別
作業系統 | 主版號 | 次版號 | 終版號 |
Windows 95 | 4 | 0 | 待查 |
Windows 98 | 4 | 10 | 1998 |
Windows 98 SE | 4 | 10 | 2222 |
Windows Me | 4 | 90 | 3000 |
Windows NT | 4 | 0 | 1381 |
類別更新紀錄
1. 最早是為了徐昇網自動分析所發展,使用在 Visual Basic 內建的啟動畫面 frmSplash.frm 中,可省去對 SysInfo.ocx 的引用
2. 在赫密斯中擴展此類別以取得登入電腦的使用者名稱,藉此可讓不同的使用者擁有不同的簽名檔
3. [88/10/25] 個人使用的作業系統更新版本到 Windows 98 SE,配合修正支援 Windows 98 SE
4.[89/11/14] 加入 Windows Me 支援
未來仍會視需求繼續發展此類別