コード例 #1
0
        /// <summary>
        /// 安装一个服务
        /// </summary>
        /// <param name="service">需要安装的服务</param>
        /// <param name="SerivceName">需要安装的服务的名字</param>
        public static void InstallService(ServiceInterface service, string ServiceName)
        {
            Dictionary<string, ServiceInterface> sv = services;
            if (sv.ContainsKey(ServiceName))
            {
                UnInstallSerive(ServiceName);
            }

            //启动服务
            service.OnServiceStart();
            sv.Add(ServiceName, service);
        }
コード例 #2
0
        /// <summary>
        /// 安装一个服务
        /// </summary>
        /// <param name="service">需要安装的服务</param>
        /// <param name="SerivceName">需要安装的服务的名字</param>
        public static void InstallService(ServiceInterface service, string ServiceName)
        {
            Dictionary <string, ServiceInterface> sv = services;

            if (sv.ContainsKey(ServiceName))
            {
                UnInstallSerive(ServiceName);
            }


            //启动服务
            service.OnServiceStart();
            sv.Add(ServiceName, service);
        }