Home > Software engineering >  VB to realize data storage memory
VB to realize data storage memory

Time:09-16

To ask, how to implement in VB on the last input data memory storage function? Is this time I open the dialog box shows the last input data?

CodePudding user response:

The data is less can put a registry
SaveSettings
GetSettings
https://blog.51cto.com/1826794/1973685
https://www.cnblogs.com/Young-shi/p/12916890.html

CodePudding user response:

Should be relatively simple, root set a text file, the program will be the last time the data is stored in a text file, the second open the file content to read text, it is ok to show where needed,
A second time after opening, if need to modify the data, it is ok to modify the contents of a text file,
Text files stored data is very flexible, can be more than one line of data, can also be a multi-line multiple data, according to your need to set up,

CodePudding user response:

In input controls onchange events recorded in the editorial content,
Less can record data to the registry, with the method of the 1st floor,
More data can be recorded to the specified text file, use the method of the second floor,
Can also use the INI mechanism records to the INI file,
I usually use INI file,
The following my program source, you consider,
Adding IniFiles in USES,
//read registration information
The function ReadRegInfo () : a Boolean;
Var
DelphiIni: TIniFile;
The begin
DelphiIni:=TInifile. Create (ExtractFilePath (Paramstr (0)) + 'registration. Ini');
StrUseUnit:=DelphiIni Readstring (' RegInfo ', 'UserName', ');
StrKey:=DelphiIni Readstring (' RegInfo ', 'Key', ');
DelphiIni. Destroy;
Result:=true;
end;
//write ini
Procedure WriteRegInfo ();
Var
DelphiIni: TIniFile;
The begin
DelphiIni:=TInifile. Create (ExtractFilePath (Paramstr (0)) + 'registration. Ini');
DelphiIni. WriteString (' RegInfo ', 'RegID, GetFirstCPU);
DelphiIni. Destroy;
end;

CodePudding user response:

Just stick is DELPHI source code,
VB you search yourself,
It was the sort of thinking
  • Related