hi
i'd like to put a counter in my program that counts how many times i've opened the program
help please
Printable View
hi
i'd like to put a counter in my program that counts how many times i've opened the program
help please
scooterbizkit
use the registry or a file to keep the counter.
how do I do that?
i mean, can you give me the exact code i need to type please?
tnx
Visual Basic Concepts
Managing Application Settings
In Microsoft Windows 3.1 and earlier versions of Windows, program settings like window positions, files used, and other items were commonly stored in .ini files. In Windows NT, Windows 95, and later versions of Windows these program settings are stored in the system registry.
Visual Basic provides a standard registry location for storing program information for applications created in Visual Basic:
HKEY_CURRENT_USER\Software\VB and VBA Program Settings\appname\section\key
Visual Basic also provides four statements and functions to manipulate the settings stored in your application's registry location.
Function or Statement Description
GetSetting function Retrieves registry settings.
SaveSetting statement Saves or creates registry settings.
GetAllSettings function Returns an array containing multiple registry settings.
DeleteSetting statement Deletes registry settings.
Note To view registry entries, use the Regedit application, included with Windows 95/98 and Windows NT.
To read more about using application settings, see the following topics:
Creating or Saving Application Settings Explains how to save new values for registry keys stored in your application's registry location.
Retrieving Application Settings Explains how to retrieve registry values stored in your application's registry location.
Deleting Application Settings Explains how to delete registry keys, sections, or an application's registry location.
--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
There's a GetSetting/SaveSetting example link in my signature.