# 读取 INI 档。

Posted by 刘柏泛 on March 23, 1998 at 16:19:28:

In Reply to: help !! 站长 posted by j.j. on March 23, 1998 at 08:44:09:

档名：Test.ini
内容：
[AppName]
KeyName=这是一个测试
宣告 API
Declare Function GetPrivateProfileString Lib "kernel32" Alias _
"GetPrivateProfileStringA" (ByVal lpApplicationName As String, _
ByVal lpKeyName As String, ByVal lpDefault As String, _
ByVal lpReturnedString As String, ByVal nSize As Long, _
ByVal lpFileName As String) As Long
读取INI内容……
Dim DataStr As String * 255
Dim Ret As Long
Ret = GetPrivateProfileString(AppName, KeyName, "", DataStr, Len(DataStr), FileName)
执行后，DataStr = "这是一个测试"

Follow Ups: