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()
        {

        }
    }
}

猜你喜欢

转载自www.cnblogs.com/sntetwt/p/8888754.html