注册 登录
编程论坛 VB.NET论坛

关于GetPrivateProfileInt函数的奇怪现象

kideng 发布于 2023-10-12 10:43, 288 次点击
在开发一个软件时,遇到了这样一个怪现象,不知道有没有高手可以提供解疑。

在每次执行GetPrivateProfileInt函数时,里面的文件参数变量会自动缩短几个字符,一直到变为C:\?后不再缩短。

相关的代码是这样的:

    Public ConfigFilePath As String = Application.StartupPath & "\Config.ini"

    CallType = GetPrivateProfileInt("AppRun", "CallType", 0, ConfigFilePath)

Config.ini文件内容如下:

[Voice]
CallRate=-5
CallVolume=20
SpVoiceType=1
[AppRun]
CalledID=10
CallType=0
2 回复
#2
kideng2023-10-15 15:47
只有本站会员才能查看附件,请 登录
#3
yinggood2023-12-30 14:06
把ConfigFilePath.tostring就可以了
1