From VB6 to WP7: App Config for WP7 Applications

27. May 2011 04:33 by Mrojas in General  //  Tags:   //   Comments (0)

 

When you start moving applications to the Silverlight and the Cloud
it wont belong for you to start wondering if you can move your applications
to be able to work on mobile devices, and it is a natural thing to wonder.

One of the best features of Artinsoft conversion tools from VB6 and other languages
to .NET is that we generate very clean code, it is not a runtime as much as possible
it is plain vanilla .NET code. And that allows us to easily move to other .NET platforms
using our evolution framework.

Moving a VB6 or Winforms applications will require some libraries not currently present in WP7,
one of those libraries are the one to read from a Config file. If you are in need of this functionaly
Alex Yakhnin has provided a good port of the Mobility Configuration block that will allow you to do something as simple as:

/ Get section
ApplicationSettingsSection section = (ApplicationSettingsSection)ConfigurationManager.GetSection("ApplicationSettings");
// Display values
this.textBlock1.Text = section.AppSettings["localServer"].Value;
this.textBlock2.Text = section.AppSettings["remoteServer"].Value;