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文件的通用类源代码示例程序 |
鏀惰棌鎴愬姛鏌ョ湅鏀惰棌>>
正在阅读:VB经典:操作.ini文件的通用类源代码VB经典:操作.ini文件的通用类源代码
2004-03-10 09:52
出处:CSDN
责任编辑:linjixiong
键盘也能翻页,试试“← →”键