How do i make a XML file that C# Is reading

How do i make a XML file that C# is reading to open a .exe file

Page 1 of 1

2 Replies - 2902 Views - Last Post: 11 July 2010 - 06:12 AM Rate Topic: -----

#1 zavis   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 11-July 10

How do i make a XML file that C# Is reading

Posted 11 July 2010 - 04:22 AM

Hello

Well.. for a few days ago i started to program in c# else i havent really got any exp. So please Sorry for my questions..

The problem is. That i wantet to make a windows form aplicationg and in there i want to make a button that when it got pressed It starts a program that you intered the path of in a XML file or something else .file

Exemple.

I go to c://example.XML and in there i find line 3 that is called path: In there i inset path:c://windows/notepad.exe
Then when i go to the program and press button 1. It starts Notepad.exe


The meaning of this is that i want to make a Launcher to a program i made.


Well i hope you guys can help me.


/zavis Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How do i make a XML file that C# Is reading

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6258
  • View blog
  • Posts: 24,026
  • Joined: 23-August 08

Re: How do i make a XML file that C# Is reading

Posted 11 July 2010 - 05:55 AM

Tutorial on Working with XML Files in C#.
Was This Post Helpful? 0
  • +
  • -

#3 Bacanze   User is offline

  • D.I.C Head

Reputation: 36
  • View blog
  • Posts: 202
  • Joined: 09-April 10

Re: How do i make a XML file that C# Is reading

Posted 11 July 2010 - 06:12 AM

So you want to make a XML file which stores file paths to various applications binary?

Should be pretty easy. Look into using the xDocument class to load your XML file, use a linq query or Xdocument.Descendants. Finally use the StartProcess class and pass the filepath as a parameter, you'll need the following namespaces.

using System.Linq;
using System.Xml;
using System.Xml.Linq;
using System.Diagnostics;

I know that might be a little vague, but look at the tutorial posted above and use Google, for example 'XDocument reading a xml file', 'starting a process c sharp' etc

Feel free to post your attempt, I'm sure people will be happy to guide you.

This post has been edited by Bacanze: 11 July 2010 - 06:13 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1