-
Quick questions:
From what I've read, ini files can only be read or written thru' the api via GetPrivateProfileString and WritePrivateProfileString. Is this statement correct?
I thought that there might be a native VB method. Is there and I just haven't found it?
Thank you for your time.
-
Hi,
Check out this link for more information on ini files. They have a demo project.
http://visualbasic.about.com/compute...y/aa121998.htm
Danial
-
Don't think so. However, earlier versions of VB might have used GetSetting and SaveSetting. (in current versions, these are used for the Registry)
-
No. You can if you want to, read and write an ini file just like any other text file. There are also other APIs that you can use like GetPrivateProfileInt.
-
You could open it as Input and then put it in a Text file and use the Instr function, that's just a lazy way/easy way of doing it.
Code:
Open "C:\Filename.exe" For Input As #1
Text1.Text = Input$(LOF(1), 1)
Close #1
If Instr(Text1, "Settings=True") Then
Msgbox "The Truth will set you free."
Else
Msgbox "That's BS!"
End If
I'd rather just use GetPrivateProfileString and WritePrivateProfileString APIs though.