起因:1 需要人工校报,来报不定时,值班人员不可能24小时目光不离开计算机屏幕.
2 卡不具备报警,也没有声卡.3 而且报文必须在整点20分前发出.
功能:有新报文时报警,或者通过主板声卡或者通过声卡播放声音文件.
使用:绿色软件,直接COPY就可以使用,或者安装在报汛接收机上 ,也许没有声卡;或者安装在其他同一个网络上,通过主板声卡或者通过声卡播放声音文件来提醒值班人员.
Option Explicit
Public Const OFS_MAXPATHNAME = 128
Public Const OF_READ = &H0
Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long '注释:建立、打开或删除文件
Declare Function GetFileInformationByHandle Lib "kernel32" (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long '注释:返回文件信息
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long '注释:关闭打开的对象句柄
Declare Function GetTimeZoneInformation Lib "kernel32" (lpTimeZoneInformation As TIME_ZONE_INFORMATION) As Long '注释:返回当前时区信息
Declare Function FileTimeToSystemTime Lib "kernel32" (lpFileTime As FileTime, lpSystemTime As SYSTEMTIME) As Long '注释:将64位时间转换为系统时间
Type FileTime
dwLowDateTime As Long
dwHighDateTime As Long
End Type
Type OFSTRUCT
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName(OFS_MAXPATHNAME) As Byte
End Type
Type BY_HANDLE_FILE_INFORMATION
dwFileAttributes As Long
ftCreationTime As FileTime
ftLastAccessTime As FileTime
ftLastWriteTime As FileTime
dwVolumeSerialNumber As Long
nFileSizeHigh As Long
nFileSizeLow As Long
nNumberOfLinks As Long
nFileIndexHigh As Long
nFileIndexLow As Long
End Type
Type SYSTEMTIME
wYear As Integer
wMonth As Integer
wDayOfWeek As Integer
wDay As Integer
wHour As Integer
wMinute As Integer
wSecond As Integer
wMilliseconds As Integer
End Type
Type TIME_ZONE_INFORMATION
bias As Long
StandardName(32) As Integer
StandardDate As SYSTEMTIME
StandardBias As Long
DaylightName(32) As Integer
DaylightDate As SYSTEMTIME
DaylightBias As Long
End Type
'注释: 取得文件的创建时间?访问时间的子程序
Sub apiFileDateTime(ByVal PathName As String, dtCreate As Date, dtAccess As Date, dtWrite As Date)
Dim FileHandle As Long
Dim FileInfo As BY_HANDLE_FILE_INFORMATION
Dim lpReOpenBuff As OFSTRUCT, ft As SYSTEMTIME
Dim tZone As TIME_ZONE_INFORMATION
Dim bias As Long
FileHandle = OpenFile(PathName, lpReOpenBuff, OF_READ)
GetFil