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>

 

posted @ 2017-08-25 16:27  -Ward-  阅读(139)  评论(0编辑  收藏  举报