鏀惰棌 (0) +1 璧� (0) +1 韪� (0) +1
鏀惰棌鎴愬姛鏌ョ湅鏀惰棌>>

正在阅读:VB经典:操作.ini文件的通用类源代码VB经典:操作.ini文件的通用类源代码

2004-03-10 09:52 出处:CSDN 作者:goj2000 责任编辑:linjixiong

  strTmp2 = ""
  For I = 1 To Len(strTmp)
  If Asc(Mid(strTmp, I, 1)) <> 0 Then
  strTmp2 = strTmp2 + Mid(strTmp, I, 1)
  End If
  Next I
  strTmp = strTmp2

  GetIniKey = strTmp
  End Function

  Public Property Let INIFileName(ByVal New_IniPath As String)
  ' Sets the new ini path
  strINI = New_IniPath
  End Property

  Public Property Get INIFileName() As String
  ' Returns the current ini path
  INIFileName = strINI
  End Property

  '***************************************清除KeyWord"键"(Sub)********
  Public Function DelIniKey(ByVal SectionName As String, ByVal KeyWord As String)
  Dim RetVal As Integer
  RetVal = WritePrivateProfileString(SectionName, KeyWord, 0&, strINI)
  End Function

  '如果是清除section就少写一个Key多一个""。
  '**************************************清除 Section"段"(Sub)********
  Public Function DelIniSec(ByVal SectionName As String) '清除section
  Dim RetVal As Integer
  RetVal = WritePrivateProfileString(SectionName, 0&, "", strINI)
  End Function

  Form1中的内容:

  Option Explicit

  '一个绝对经典的在VB中操作.ini文件的通用类源代码示例程序




察看评论详细内容 我要发表评论
作者笔名简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品
鎵嬫満璁块棶鍥炲埌椤堕儴