WPF应用程序exe接收参数

时间:2023-03-09 15:45:49
WPF应用程序exe接收参数

using System;
using System.ServiceProcess;

namespace GoShopService
{
    public partial class Service1 : ServiceBase
    {
        protected override void OnStart(string[] args)
        {
            try
            {
                if (args.Length == 0)
                {

}
                if (args[0].ToLower() == "/i" || args[0].ToLower() == "-i")
                {

}
            }
            catch (Exception ex)
            {

}
        }
        protected override void OnStop()
        {

}
    }
}