水情报汛职守机来报提醒程序

这是一个自动监测并提醒值班人员新报文的程序,尤其适用于没有声卡的报汛接收机。程序通过监测文件变化,结合主板声卡或播放声音文件进行报警,确保在整点20分前接收到报文。
摘要由CSDN通过智能技术生成

起因: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值