Register | Login | |||||
Main
| Memberlist
| Active users
| ACS
| Commons
| Calendar
| Online users Ranks | FAQ | Color Chart | Photo album | IRC Chat |
| |
0 user currently in Programming. | 3 guests |
Acmlm's Board - I2 Archive - Programming - [Visual Basic] storing and using settings in an INF file | | | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
User | Post | ||
Tuvai Permanently banned for account hacking. Level: 24 Posts: 115/211 EXP: 74894 For next: 3231 Since: 03-15-04 Since last post: 566 days Last activity: 339 days |
| ||
Well, topic title pretty much explains it all. I'm making a program right now but I came to the conslution that I haven't really been using any effective storage method yet (other then databases, but this program won't be using one). I think an INF file will be ideal for this. The settings we're talking about are just simple yes/no (1/0) settings and a few, short text strings. So, anybody can give me a push on how to store and use these settings in an INF file? Oh yeah, obviously, I need a way to edit the INF file so I can edit the settings, too. |
|||
Jesper Busy, busy, busy. Level: 69 Posts: 136/2390 EXP: 2856000 For next: 13743 Since: 03-15-04 From: Sweden. Since last post: 176 days Last activity: 79 days |
| ||
http://www.vbcity.com/forums/faq.asp - tutorials for almost everything, including, I think, INF writing and registry doodads. | |||
Tuvai Permanently banned for account hacking. Level: 24 Posts: 116/211 EXP: 74894 For next: 3231 Since: 03-15-04 Since last post: 566 days Last activity: 339 days |
| ||
Oh yeah, forgot to mention that I don't want to use registry for this, anyway, I'll look through the page in that link you just posted. | |||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 235/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
If INF reading/writing is the same as INI reading/writing then you'll have to use APIs. Check www.planet-source-code.com for that. | |||
Tuvai Permanently banned for account hacking. Level: 24 Posts: 117/211 EXP: 74894 For next: 3231 Since: 03-15-04 Since last post: 566 days Last activity: 339 days |
| ||
Ah, yes, I meant INI files, not INF. I don't know why I keep sayingand typing INF since I never work with them. | |||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 241/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=28349&lngWId=1 and http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=6138&lngWId=1 Those are pretty good ones, I can't find the one I once used anymore though. |
|||
Tuvai Permanently banned for account hacking. Level: 24 Posts: 118/211 EXP: 74894 For next: 3231 Since: 03-15-04 Since last post: 566 days Last activity: 339 days |
| ||
Well, those would help if they weren't huge source codes for stuff more than just ini file storing of which I don't understand most anyway. | |||
Dish Spiny Level: 38 Posts: 12/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
I don't know about VB... but in C++: WritePrivateProfileString("Section","ItemName","Value","C:\\pathname\\file.ini"); would appear as:
In the file at the specified path (C:\pathname\file.ini) To read, you would do: GetPrivateProfileString("Section","ItemName","DefaultValue",pointertostring,sizeofstring,"C:\\pathname\\file.ini"); DefaultValue is used if the Item does not appear in the ini file. 'pointertostring' is a string which receives the data... and 'sizeofstring' is the size of the string buffer. Granted... VB probably does this differently, but I believe these functions are WinAPI calls, so VB should be able to access them in one form or another. Just search for those function names on MSDN or something. |
|||
dan Snap Dragon Level: 43 Posts: 21/782 EXP: 534516 For next: 30530 Since: 03-15-04 Since last post: 20 hours Last activity: 14 hours |
| ||
This probably doesn't apply with your case, but with those API calls, there's a 65k limitation on the size of the INI file. I ran into it a few times when using Visual Basic. | |||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 246/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
Originally posted by dan But then you could create your own routine instead of using an API. |
|||
Dish Spiny Level: 38 Posts: 13/596 EXP: 355646 For next: 14801 Since: 03-15-04 From: Disch Since last post: 18 days Last activity: 18 days |
| ||
I prefer binary ".dat" files anyway. Less string formatting, smaller file size, less work to read/write, and faster. Only downside is that the user can't really edit them in a text editor... but then again, that's what your program's interface is for. | |||
Tuvai Permanently banned for account hacking. Level: 24 Posts: 121/211 EXP: 74894 For next: 3231 Since: 03-15-04 Since last post: 566 days Last activity: 339 days |
| ||
Disch, the settings I'm talking about are mostly boolean values and 2, maybe later 3 strings, I don't really think speed is an issue here. Anyway, I got ini reading and writing working now. I found a script online (though I got it cropped to like, 5 times as small ). |
|||
Darth Coby Vire Dacht je nou echt dat het over was? Dacht je nou echt dat ik gebroken was? Nee toch? Nou kijk eens goed op uit je ogen gast. zonder clic heb je geen kloten tjap... bitch Level: 55 Posts: 286/1371 EXP: 1240774 For next: 73415 Since: 03-15-04 From: Belgium Since last post: 2 days Last activity: 9 hours |
| ||
Originally posted by Tuvai Well yeah, they're only there to point you in the right direction. |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread |
Acmlm's Board - I2 Archive - Programming - [Visual Basic] storing and using settings in an INF file | | | |