Link to home
Start Free TrialLog in
Avatar of Cyber-Drugs
Cyber-DrugsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Reading XML and running an external application

Hi guys,

I am looking to make an autorun application with C#, now I basically just need to know how to do two things...

1/ How to read an XML file (filenames)
2/ How to run external applications (setup files)

If someone could give me the rough code I need, I can then edit it to do what I want.

Cheers!
Avatar of gbzhhu
gbzhhu
Flag of United Kingdom of Great Britain and Northern Ireland image


Q 2

System.Diagnostics.Process.Start(@"path to your setup.exe goes here");  
will run extenal file

If you want to control window state of the started process then you will have to create a processinfo object and set it up as you want then pass that to the start method above instead of the path

Q1 .... code posted next while you digest answer to Q2
ASKER CERTIFIED SOLUTION
Avatar of gbzhhu
gbzhhu
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Cyber-Drugs

ASKER

Thanks for the quick response, just a quick question...

What structure is the XML for your example?

Cheers!
This is the XML file

<?xml version="1.0" encoding="utf-8"?>
<UserInfo xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Username>foo.fooSurname@server.co.uk</Username>
  <Password>password</Password>
</UserInfo>
Sorry, I forgot all about this code!!

Works perfectly, cheers! :)