´--------cIniFile.cls 代码----------------
´这里定义了一个cIniFile类
Option Explicit
´// Private member that holds a reference to
´// the path of our ini file
Private strInI As String
´// Win API Declares
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
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 Function MakePath(ByVal strDrv As String, _
ByVal strDir As String) As String
´// Makes an INI file: Guarantees a sub dir
Do While Right$(strDrv, 1) = "\"
strDrv = Left$(strDrv, Len(strDrv) - 1)
Loop
Do While Left$(strDir, 1) = "\"
strDir = Mid$(strDir, 2)
Loop
´// Return the path
MakePath = strDrv & "\" & strDir
End Function
Public Sub CreateIni(strDrv As String, strDir As String)
´// Make a new ini file
strInI = MakePath(strDrv, strDir)
End Sub
Public Sub WriteFile(strSection As String, _
strKey As String, _
strValue As String)
【VB源码推荐:一个操作Ini文件的类】相关文章:
2025年外省高中学业水平合格性考试成绩转入江苏认定的通告公布03-23
Vb中控件的自动排列03-23
写未来的作文300字03-23
Our Mother Is the Same 我们的妈妈是一样的03-23
小学父爱的作文600字03-23
2018国家电网新大纲财会类市场模拟卷多选题(二)03-23
荷花作文600字03-23
2016年职称英语综合类阅读判断练习八03-23
07年4月北师大“中国古代文学史(一)”串讲(5)03-23
寓言作文300字03-23
汪涵讲述小时候成长经历:鸡毛掸子的故事03-23
关于清明节的英语作文:清明节03-23
