[VB.NET]为怎么用GetPrivateProfileInt无法读取INI文件数据,

前端之家收集整理的这篇文章主要介绍了[VB.NET]为怎么用GetPrivateProfileInt无法读取INI文件数据,前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
为怎么用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 ","默认值 ",长度,path1) __________________________________________________________________________ 原文链接:https://www.f2er.com/vb/264068.html

猜你在找的VB相关文章