Solved

Adding and Parsing custom app.config files.

Posted on 2007-03-31
1
192 Views
Last Modified: 2013-11-25
I am looking to create a vb.net service that runs applications (i.e. notepad, ie, etc) when it is stoped or started.  I want the application paths to be configurable via xml file (like app.config).

I can not figure out how to place the nodes in app.config and then parse them out in the OnStart sub.

My thoughts on the xml section are as follows

<OnStart>
 <app name="..." path="..." ExecOrder="1" />
 <app name="..." path="..." ExecOrder="2" />
 <app name="..." path="..." ExecOrder="3" />
</OnStart>
<OnStop>
 <app name="..." path="..." ExecOrder="1" />
 <app name="..." path="..." ExecOrder="2" />
 <app name="..." path="..." ExecOrder="3" />
</OnStop>


 Protected Overrides Sub OnStart(ByVal args() As String)
 
  For Each Node in OnStart
        System.Diagnostics.Process.Start("Path")
  Next

 End Sub
0
Comment
Question by:makman111
1 Comment
 
LVL 19

Accepted Solution

by:
Rimvis earned 500 total points
ID: 18834894
I suggest you place your settings in separate XML file.
Take a look here:
http://www.codeproject.com/vb/net/parsefilecode.asp
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to line 23 54
Sending an input value from a view to a controller in MVC 3 22
FInd Image Control Gridview 3 21
Input parameteres to DragOver 2 19
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question