RunExecuteFile
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Windows.Forms; namespace RunExecuteFileClient { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { string s = System.Configuration.ConfigurationSettings.AppSettings["exeFiles"]; if (!string.IsNullOrEmpty(s)) { string[] array = s.Split('|'); foreach (var item in array) { if (!string.IsNullOrEmpty(item)) { Process.Start(item).WaitForExit(); } } } } } }
RunExecuteFile
APP.CONFIG
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="exeFiles" value="1.exe|2.exe"/> </appSettings> </configuration>