打印本文 打印本文 关闭窗口 关闭窗口
VB断点拷贝大文件
作者:武汉SEO闵涛  文章来源:敏韬网  点击数7617  更新时间:2009/4/23 15:43:36  文章录入:mintao  责任编辑:mintao
End Function ''''** 从系统配置文件中读取相应配置数值 Public Function GetIniNum(ByVal sSection As String, _ ByVal sKey As String, _ Optional ByVal lDefault As Long = c_NullID) As Long Dim lReturn As Long lReturn = GetPrivateProfileInt(sSection, sKey, lDefault, IniFileName) GetIniNum = lReturn End Function ''''** 从配置文件中读取Boolean类型变量的设置 Public Function GetIniBoolean _ (ByVal strSection As String, _ ByVal strKey As String, _ Optional ByVal bolDefault As Boolean = False) _ As Boolean Dim strData As String strData = GetIniStr(strSection, strKey, IIf(bolDefault, "True", "False")) GetIniBoolean = CBool(strData) End Function ''''** 将配置信息写入配置文件中 Public Sub WriteIniStr(ByVal sSection As String, ByVal sKey As String, ByVal sValue As String) Dim lReturn As Long lReturn = WritePrivateProfileString(sSection, sKey, sValue, IniFileName) End Sub ''''** ''''** 初始化模块 ** ''''** Public Sub Reset() IniFileName = "" CurrentSection = "" CurrentData = "" End Sub ''''** ''''** 获得设置值 ** ''''** Public Property Get IniValue(ByVal strKey As String) As Variant Dim strData As String Dim strTemp As String strData = GetIniStr(CurrentSection, strKey, "") If strData = "" Then IniValue = "" Else If IsNumeric(strData) Then IniValue = Val(strData) Exit Property End If If IsDate(strData) Then IniValue = CDate(strData) Exit Property End If strTemp = UCase(strData) If strTemp = "TRUE" Or strTemp = "FALSE" Then IniValue = CBool(strData) Exit Property End If IniValue = strData End If End Property ''''** ''''** 保存设置值 ** ''''** Public Property Let IniValue(ByVal strKey As String, ByVal vData As Variant) Dim strData As String If IsDate(vData) Then strData = Format(vData, "yyyy-mm-dd hh:mm:ss") ElseIf TypeName(vData) = "String" Then strData = vData Else strData = Trim(CStr(vData)) End If WriteIniStr CurrentSection, strKey, strData End Property ''''** ''''** 获得字符串设置 ''''** Public Property Get IniString(ByVal strKey As String) As String IniString = GetIniStr(CurrentSection, strKey) End Property ''''** ''''** 保存字符串设置 ''''** Public Property Let IniString(ByVal strKey As String, ByVal strData As String) WriteIniStr CurrentSection, strKey, strData End Property ''''** ''''** 获得数字设置 ''''** Public Property Get IniNumber(ByVal strKey As String, Optional ByVal sngDefault As Single = 0) As Single Dim strData As String strData = GetIniStr(CurrentSection, strKey) If IsNumeric(strData) Then IniNumber = strData Else IniNumber = sngDefault End If End Property '''' Public Property Let IniNumber(By

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  下一页

打印本文 打印本文 关闭窗口 关闭窗口