Hi Agnes
You are thinking along the right lines - the .ini file is now a .config
file: for an app like Test.exe, the file would be called Test.exe.config.
However: you must consider the security impact of data like userid /
password being stored in the file...
As a quick intro, in Visual Studio .NET, you create a file called app.config
in your solution (add a new Application Configuration file to the solution,
and this will be done for you). Then the build process will automatically
change the filename to the correct one for you.
The config file uses XML - the easiest way to get started using dynamic
properties is in the design time view, select a control (say your Form), and
scroll to the top of the properties window - select Dynamic Properties, and
click on the ... button. Select Text, and you will see that your app.config
file will have been modified like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<!-- User application and configured property settings go here.-->
<!-- Example: <add key="settingName" value="settingValue"/> -->
<add key="Form1.Text" value="Form1" />
</appSettings>
</configuration>
You will also notice that the text property in the properties window will
have a small blue glyph by it indicating that it is a dynamic property, and
the following code will have been added into the design time environment for
you too.
Dim configurationAppSettings As System.Configuration.AppSettingsReader = New
System.Configuration.AppSettingsReader
Me.Text = CType(configurationAppSettings.GetValue("Form1.Text",
GetType(System.String)), String)
When you build the application, you will find that you can change the
..config file, and when you start your application, it will read the
information from the config file.
HTH
Nigel Armstrong