您好,欢迎光临本网站![请登录][注册会员]  
文件名称: VB编程经验手册,chm
  所属分类: VB
  开发工具:
  文件大小: 435kb
  下载次数: 0
  上传时间: 2009-09-03
  提 供 者: zhjh****
 详细说明: VB编程经验总结,范畴:VB 文件名SourceDB.ini文件 Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long '以下两个函数,读/写ini文件,固定节点setting,in_key为写入/读取的主键 '仅仅针对是非值 'Y:yes,N:no,E:error Public Function GetIniTF(ByVal In_Key As String) As Boolean On Error GoTo GetIniTFErr GetIniTF = True Dim GetStr As String GetStr = VBA.String(128, 0) GetPrivateProfileString "Setting", In_Key, "", GetStr, 256, App.Path & "\SourceDB.ini" GetStr = VBA.Replace(GetStr, VBA.Chr(0), "") If GetStr = "1" Then GetIniTF = True GetStr = "" Else GoTo GetIniTFErr End If Exit Function GetIniTFErr: Err.Clear GetIniTF = False GetStr = "" End Function Public Function WriteIniTF(ByVal In_Key As String, ByVal In_Data As Boolean) As Boolean On Error GoTo WriteIniTFErr WriteIniTF = True If In_Data = True Then WritePrivateProfileString "Setting", In_Key, "1", App.Path & "\SourceDB.ini" Else WritePrivateProfileString "Setting", In_Key, "0", App.Path & "\SourceDB.ini" End If Exit Function WriteIniTFErr: Err.Clear WriteIniTF = False End Function '以下两个函数,读/写ini文件,不固定节点,in_key为写入/读取的主键 '针对字符串值 '空值表示出错 Public Function GetIniStr(ByVal AppName As String, ByVal In_Key As String) As String On Error GoTo GetIniStrErr If VBA.Trim(In_Key) = "" Then GoTo GetIniStrErr End If Dim GetStr As String GetStr = VBA.String(128, 0) GetPrivateProfileString AppName, In_Key, "", GetStr, 256, App.Path & "\SourceDB.ini" GetStr = VBA.Replace(GetStr, VBA.Chr(0), "") If GetStr = "" Then GoTo GetIniStrErr Else GetIniStr = GetStr GetStr = "" End If Exit Function GetIniStrErr: Err.Clear GetIniStr = "" GetStr = "" End Function Public Function WriteIniStr(ByVal AppName As String, ByVal In_Key As String, ByVal In_Data As String) As Boolean On Error GoTo WriteIniStrErr WriteIniStr = True If VBA.Trim(In_Data) = "" Or VBA.Trim(In_Key) = "" Or VBA.Trim(AppName) = "" Then GoTo WriteIniStrErr Else WritePrivateProfileString AppName, In_Key, In_Data, App.Path & "\SourceDB.ini" End If Exit Function WriteIniStrErr: Err.Clear WriteIniStr = False End Function ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: VB 编程
 输入关键字,在本站1000多万海量源码库中尽情搜索: