| )
lngCountStart = lStart
lngCountCurrent = lStart
End Property
''''** 累加数据 **
Public Sub Count(Optional ByVal lCount As Long = 1)
lngCountCurrent = lngCountCurrent + lCount
lngTickCurrent = GetTickCount()
End Sub
''''** 获得速度 **
Public Property Get Speed() As Long
''''lngTickCurrent = GetTickCount()
If lngTickLast = lngTickCurrent Then
Speed = lngSpeed
Else
Speed = (lngCountCurrent - lngCountLast) / ((lngTickCurrent - lngTickLast) / 1000)
lngSpeed = Speed
lngTickLast = lngTickCurrent
lngCountLast = lngCountCurrent
End If
End Property
''''** 数据是否是最新更新的 **
Public Property Get NewSpeed() As Boolean
Dim bolNew As Boolean
If lngTickCurrent > lngTickLast + 1000 Then
bolNew = True
Else
bolNew = False
End If
NewSpeed = bolNew
End Property
''''** 本模块结束 ****************************************************************
###############################################################################
clsIniFile.cls 内容
###############################################################################
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 ''''True
Persistable = 0 ''''NotPersistable
DataBindingBehavior = 0 ''''vbNone
DataSourceBehavior = 0 ''''vbNone
MTSTransactionMode = 0 ''''NotAnMTSObject
END
Attribute VB_Name = "clsIniFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
Option Explicit
''''******************************************************************************
''''**
''''** INI文件操作类模块
''''**
''''** 本模块定义了INI文件读写的API操作及中间的数据转化
''''**
''''** 编制: 袁永福
''''** 时间: 2001-12-11
''''**
''''** 该模块在配第5版补丁的VB6.0企业版/Windows98第二版的环境下调试通过
''''**
''''******************************************************************************
''''** 定义变量 **
Public IniFileName As String '''' 当前的配置文件名
Public CurrentSection As String '''' 当前的类别
Public CurrentData As String '''' 当前值
'''' Public AutoSave As Boolean '''' 是否自动保存
''''** 声明API函数 **
Private Declare Function GetPrivateProfileString& Lib "kernel32" Alias _
"GetPrivateProfileStringA" _
(ByVal lpAppName$, _
ByVal lpKeyName$, _
ByVal lpDefault$, _
ByVal lpRetStr$, _
ByVal nSize&, _
ByVal lpFileName$)
Private Declare Function GetPrivateProfileInt& Lib "kernel32" Alias _
"GetPrivateProfileIntA" _
(ByVal lpAppName$, _
ByVal lpKeyName$, _
ByVal nDefault&, _
ByVal lpFileName$)
Private Declare Function WritePrivateProfileString& Lib "kernel32" Alias _
"WritePrivateProfileStringA" _
(ByVal lpAppName$, _
ByVal lpKeyName$, _
ByVal lpString$, _
ByVal lpFileName$)
''''******************************************************************************
''''************* 定义读写配置文件的接口函数 ***********************
''''******************************************************************************
''''** 从系统配置文件中读取相应配置字符串
Public Function GetIniStr(ByVal sSection As String, _
ByVal sKey As String, _
Optional ByVal sDefault As String = "") As String
Dim sReturnStr As String
Dim lTemp As Long
sReturnStr = Space(1024)
''''此处虽然设定在读不成功时为NONE,但绝对不会为NONE(webpaul)
GetPrivateProfileString sSection, sKey, sDefault, _
sReturnStr, 1024, IniFileName
sReturnStr = Trim$(sReturnStr)
lTemp = LenB(sReturnStr)
If lTemp > 0 Then
sReturnStr = Trim(MidB(sReturnStr, 1, lTemp - 1))
End If
If sReturnStr = "" Then
sReturnStr = sDefault
End If
GetIniStr = sReturnStr
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 |