<script type="text/javascript">
</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
为怎么用GetPrivateProfileInt无法读取INI文件数据,
出现 "从字符串“TextBox1”到类型“Integer”的强制转换无效。 "错误,是那里错了呢?
---------------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = GetPrivateProfileInt( "Form ", "file1 ", TextBox1.Text, path1)
TextBox2.Text = GetPrivateProfileInt( "Form ", "file2 ", TextBox2.Text, path1)
TextBox3.Text = GetPrivateProfileInt( "Form ", "file3 ", TextBox3.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)
TextBox3.Text = GetPrivateProfileInt( "Form ", "file3 ", "默认值 ", TextBox3.Text, 长度,path1)
__________________________________________________________________________
为怎么用GetPrivateProfileInt无法读取INI文件数据,
出现 "从字符串“TextBox1”到类型“Integer”的强制转换无效。 "错误,是那里错了呢?
---------------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox1.Text = GetPrivateProfileInt( "Form ", "file1 ", TextBox1.Text, path1)
TextBox2.Text = GetPrivateProfileInt( "Form ", "file2 ", TextBox2.Text, path1)
TextBox3.Text = GetPrivateProfileInt( "Form ", "file3 ", TextBox3.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)
TextBox3.Text = GetPrivateProfileInt( "Form ", "file3 ", "默认值 ", TextBox3.Text, 长度,path1)
__________________________________________________________________________