pb读文件问题

来源:百度知道 编辑:UC知道 时间:2024/05/29 18:25:23
把*.ini文件读入,然后扔到label里
怎样在label里换行显示

模块1:
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 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

Public Funtion GetINIValue(sFile As string,sRoot As string,sKey As String) As String
Dim s As String * 256

GetPrivateProfileString sRoot, _
SKey, "", s, 256, sFile

GetINIValue = s
End Function

窗体:
Label1.BackColor = CLng(GetINIValue("主键","项目","文件路径"))

INI: