|
Примеры работы с BIOS |
|
|
Данный пример покажет дату Bios'а ВАРИАНТ 1
'ВАЖНОЕ ПРИМЕЧАНИЕ: Используйте данный код
только в Windows 95/98
'Использование кода в Windows 2000/NT приводит к краху
приложения
Private Declare Sub GetMem1 Lib "msvbvm50.dll" (ByVal MemAddress As Long, var
As Byte)
Private Function GetBIOSDate() As String
Dim p As Byte, MemAddr As Long, sBios As String
Dim i As Integer
MemAddr = &HFFFF5
For i = 0 To 7
Call GetMem1(MemAddr + i, p)
sBios = sBios & Chr$(p)
Next i
GetBIOSDate = sBios
End Function
Private Sub Command1_Click()
MsgBox "Дата Bios'а: " & GetBIOSDate
End Sub
ВАРИАНТ 2
Private Type BIOS_DATE
s As String * 8
End Type
Private Declare Sub CopyMemory Lib "Kernel32" Alias "RtlMoveMemory"
(pDest As Any, pSource As Any, ByVal ByteLen As Long)
Public Function BIOS() As String
Dim sDB As BIOS_DATE
CopyMemory sDB, ByVal &HFFFF5, 8&
BIOS = sDB.s
End Function
Private Sub Command1_Click()
MsgBox BIOS
End Sub
|
|
|
|
|
|
|