SetCommandLineArgs() public static method

public static SetCommandLineArgs ( string serviceName, string parameters ) : void
serviceName string
parameters string
return void
Example #1
0
        public override void Install(IDictionary stateSaver)
        {
            this.Uninstall(stateSaver);

            var serviceSubname = stateSaver["subName"] as string;

            base.Install(stateSaver);
            ServiceEx.SetCommandLineArgs(Service1.GetServiceName(serviceSubname), serviceSubname);

            using (var sc = new ServiceController(Service1.GetServiceName(serviceSubname)))
            {
                sc.Start();
                sc.Refresh();
            }
        }