hi,

I am new to these online threads ..
i had a question: i am migrating vb6 to vb.net.
the ini.file of vb6 has to be converted to app.config file, and we has to use this app.config in our code by removing ini file.
how to create app.config for this inifile... please any one can respond quickly.

my inifile is like this ..
[Parms]
Language=English

[Enlish]
1=Product Library Copy
2=Sorce File.
3=Destination File
4=Browse..
5=Copy Files
6=Exit
7=Cannot Copy File:
8=Destination file exits.Overwrite?
9=File have been copied
12=Pro/Space Product Libraries

[Japanese]
1= >>.if%fcfuf%fSfRsgdg
2=f\[fXftf@fCf<:
3=fRs[$,Iftf@fCf<:
4=ZQAC....
5=...............Like this till 12 fields......

Dani AI

Generated

The INI in ’s post (sections for Parms/English/Japanese with numbered message IDs) is a typical VB6 pattern. For .NET Windows apps, putting UI text into resource files (.resx) is a cleaner, more maintainable approach than keeping large language blocks in app.config. ’s app.config idea is fine for small configuration values, but localized UI strings benefit from the .resx + satellite-assembly model: built-in culture fallback, Unicode support, and strong-typing in VB.NET.

Recommended migration workflow:

  1. Extract all INI strings and assign descriptive resource keys (avoid numeric IDs). Example keys: Menu_ProductLibraryCopy, Menu_SourceFile, etc.
  2. Create Strings.resx (default) and Strings.ja.resx (Japanese) and paste translations under the same keys.
  3. Replace numeric lookups in the code with resource lookups (strongly-typed resources or ResourceManager). This keeps code readable and makes translators’ work easier.

Example VB.NET snippets (behavior depends on CurrentUICulture):

' switch UI culture (optional)
Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo("ja-JP")

' strongly-typed access (VB)
Dim txt As String = My.Resources.Menu_ProductLibraryCopy
' dynamic lookup with ResourceManager
Dim rm As New System.Resources.ResourceManager("MyApp.Strings", GetType(Form1).Assembly)
Dim txt As String = rm.GetString("Menu_ProductLibraryCopy", New Globalization.CultureInfo("ja"))

Practical notes and pitfalls: preserve the original INI encoding when reading it (ANSI vs Shift_JIS) to avoid garbled Japanese characters; use ResXResourceWriter or a simple script to convert INI sections into .resx entries; if translations must be editable without rebuilding, use an external XML/JSON file or a small database rather than embedding everything in app.config. For non-localizable settings (paths, toggles), app.config or the Settings designer remain appropriate.

The configuration is put into a XML file like this

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="errormail.verzenden" value="1"/>
    <add key="errormail.address.from" value="noreply@hello.com"/>
    <add key="errormail.address.to" value="paperclip@msn.com"/>
    <add key="errormail.address.cc" value=""/>
  </appSettings>
</configuration

You can retrieve these settings with

string keyValue = System.Configuration.ConfigurationManager.AppSettings[KeyName];

or in VB.NET

Dim keyValue as string = System.Configuration.ConfigurationManager.AppSettings(KeyName)

You also have to add an reference to System.configuration to your project. (project references)

For addition info see e.g. the MSDN at the Microsoft-site

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.