' Write to strINI WritePrivateProfileString strSection, strKey, strValue, strINI End Sub
Public Function GetIniKey(strSection As String, strKey As String) As String Dim strTmp As String Dim lngRet As String Dim I As Integer Dim strTmp2 As String
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