VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

cIniFile

Steve McMahon  (1 Submission)   Files/File Controls/Input/Output   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

Complete access to INI files through a simple class module, which works with VB4 16,32 and VB5. This class module allows you to read/write INI values, delete values, delete sections and query whole sections through a simple inteface.

Inputs
Here is a sample of using the cIniFile class: dim cIni as new cIniFile with cIni .Path = "C:\WINDOWS\SYSTEM.INI" ' Use GetWindowsDir() call to find the correct dir .Section = "boot" ' Look under the section headed [boot] .Key = "shell" ' Search for shell= if (ucase$(trim$(.Value)) = "EXPLORER.EXE") then ' Get the section value msgbox "Da Shell is here",vbInformation else msgbox "Da Computer is too old....",vbExclamation endif ' end with

Assumes
Save the code into a file called cIniFile.cls and add it to your project. Follow the sample code in the top comment block to try it out.

Side Effects
None.

Rate cIniFile (4(4 Vote))
cIniFile.bas

cIniFile Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters