Start() public method

线程的启动函数
public Start ( ) : void
return void
Esempio n. 1
0
        /// <summary>
        /// 开始运行服务
        /// </summary>
        /// <param name="args">args</param>
        /// <param name="serviceName">服务名</param>
        /// <param name="serviceInit">服务初始化</param>
        public static void StarUpService(string args, string serviceName, ServiceInit serviceInit)
        {
            if (args == "0")
            {
                //运行在console方式下
                serviceInit.Start();
            }
            else if (args == "1")
            {
                //运行在windows服务方式下
                ServiceBase.Run(new ServiceRun(serviceInit, serviceName));
            }
            else
            {
                Debug.Assert(false);

                //运行在windows服务方式下
                ServiceBase.Run(new ServiceRun(serviceInit, serviceName));
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 开始运行服务
        /// </summary>
        /// <param name="args">args</param>
        /// <param name="serviceName">服务名</param>
        /// <param name="serviceInit">服务初始化</param>
        public static void StarUpService(string args, string serviceName, ServiceInit serviceInit)
        {
            if (args == "0")
            {
                //运行在console方式下
                serviceInit.Start();
            }
            else if (args == "1")
            {
                //运行在windows服务方式下
                ServiceBase.Run(new ServiceRun(serviceInit, serviceName));
            }
            else
            {
                Debug.Assert(false);

                //运行在windows服务方式下
                ServiceBase.Run(new ServiceRun(serviceInit, serviceName));
            }
        }