| View previous topic :: View next topic |
| Author |
Message |
homer_simpson Grandmaster Cheater
Reputation: 0
Joined: 25 Feb 2007 Posts: 596
|
Posted: Sat Feb 16, 2008 12:18 pm Post subject: [VB6] Reading INI files |
|
|
I know the API but i cant seem to find a good tut on google.
Imagine i wanted to read this Ini file:
[Test]
Valueofbytes=29
And put the Valueofbytes thing on a Textbox.
Could some one make me a sample?
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
Posted: Sat Feb 16, 2008 12:23 pm Post subject: |
|
|
I would personally recomend you to use a xml instead of a ini.
They are so out of date you know.
_________________
Intel over amd yes. |
|
| Back to top |
|
 |
homer_simpson Grandmaster Cheater
Reputation: 0
Joined: 25 Feb 2007 Posts: 596
|
Posted: Sat Feb 16, 2008 12:24 pm Post subject: |
|
|
So whats easyer to make a ini or xml?
PS: Aww and simpathised with ini files...
|
|
| Back to top |
|
 |
NINTENDO Grandmaster Cheater Supreme
Reputation: 0
Joined: 02 Nov 2007 Posts: 1371
|
|
| Back to top |
|
 |
homer_simpson Grandmaster Cheater
Reputation: 0
Joined: 25 Feb 2007 Posts: 596
|
Posted: Sat Feb 16, 2008 12:49 pm Post subject: |
|
|
| k gothcha but first of all can VB6 write xml files and then load them?
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sat Feb 16, 2008 12:49 pm Post subject: |
|
|
| search! I even posted writing/reading INI files in here general programming
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Sun Feb 17, 2008 1:28 pm Post subject: |
|
|
Eh, INIs are hardly outdated and are probably still one of the most used. Anyway, you will need the following API to read from an INI:
GetPrivateProfileInt
GetPrivateProfileSection
GetPrivateProfileSectionNames
GetPrivateProfileString
And for writing to:
WritePrivateProfileSection
WritePrivateProfileString
If you haven't guessed already, beings that INI files are text files, you don't write numeric values back to the file. You always write strings. So thats why theres only 2 write functions.
You can find all these API on the MSDN website, or over at allapi.net along with examples.
_________________
- Retired. |
|
| Back to top |
|
 |
|