为怎么用GetPrivateProfileInt无法读取INI
文件数据,出现 "从字符串“Text
Box1”到类型“Integer”的强制转换无效。 "
错误,是那里错了呢? --------------------------------------------------------------------- Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load Text
Box1.Text = GetPrivateProfileInt( "Form ","file1 ",Text
Box1.Text,path1) Text
Box2.Text = GetPrivateProfileInt( "Form ","file2 ",Text
Box2.Text,path1) Text
Box3.Text = GetPrivateProfileInt( "Form ","file3 ",Text
Box3.Text,path1) End Sub ===================================================================== INI
文件内容 [Form] file1=C:/WINDOWS/IsUn0804.exe file2=C:/WINDOWS/MicCal.exe file3=C:/WINDOWS/twunk_32.exe __________________________________________________________________________ 你的参数
错误了. 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) Text
Box3.Text = GetPrivateProfileInt( "Form ","默认值 ",长度,path1) __________________________________________________________________________
原文链接:https://www.f2er.com/vb/264068.html