INI文件是Win16时代程序记录自身信息的方式,尽管当时的Windows 3.1也有注册表。在Win32时代,INI文件依然有其生存知道。比如一个绿色软件等等。 下面是读写INI文件的方法,为此我写了两个函数。 首先,声明两个API函数WritePrivateProfileString和GetPrivateProfileString,一下是代码: Private Sub WriteToIni(ByVal Filename As String, ByVal Section As String, ByVal Key As String, ByVal Value As String) Dim buff As String * 128 buff = Value + Chr(0) WritePrivateProfileString Section, Key, buff, Filename End Sub Private Function ReadFromIni(ByVal Filename As String,ByVal Section As String, ByVal Key As String) As String […]
Read the rest of this entry »