加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

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

发布时间:2020-12-16 23:48:45 所属栏目:大数据 来源:网络整理
导读:为怎么用GetPrivateProfileInt无法读取INI文件数据,出现 "从字符串“TextBox1”到类型“Integer”的强制转换无效。 "错误,是那里错了呢? --------------------------------------------------------------------- Private Sub Form1_Load(ByVal sender As
为怎么用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) __________________________________________________________________________

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读