Esempio n. 1
0
        public override bool Stop(out string msg)
        {
            string arguments = string.Format(" stop site \"{0}\"", _siteName);

            msg = CommandExeHelper.Run("inetsrv/appcmd.exe", arguments);
            return(true);
        }
Esempio n. 2
0
        public override bool Stop(out string msg)
        {
            string arguments = string.Format("//Nologo iisweb.vbs /stop \"{0}\"", _siteName);

            msg = CommandExeHelper.Run("cscript.exe", arguments);
            return(true);
        }
Esempio n. 3
0
        public override bool RecycleAppPool(out string msg)
        {
            string arguments = string.Format(" recycle apppool /apppool.name:\"{0}\"", _siteName);

            msg = CommandExeHelper.Run("inetsrv/appcmd.exe", arguments);
            return(true);
        }
Esempio n. 4
0
        public override bool RecycleAppPool(out string msg)
        {
            //回收程序池
            string arguments = string.Format(" iisapp.vbs /a \"{0}\" /r", _siteName);

            msg = CommandExeHelper.Run("cscript.exe", arguments);
            return(true);
        }
Esempio n. 5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="taskName">任务计划名</param>
        /// <returns></returns>
        public static bool CheckRun(string taskName)
        {
            FileInfo file = new FileInfo(programBat);

            if (!file.Exists)
            {
                throw new FileNotFoundException("任务计划查询批处理文件不存在", programBat);
            }
            if (file.Directory != null)
            {
                string path   = file.Directory.FullName;
                string result = CommandExeHelper.Run(programBat, taskName, path);
                int    index  = result.IndexOf(taskName);
                if (index != -1)
                {
                    result = result.Substring(index, result.Length - index);
                    return(result.ToLower().IndexOf("running") != -1);
                }
            }
            return(false);
        }
Esempio n. 6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="taskName">任务计划名</param>
        /// <returns></returns>
        public static string StopRun(string taskName)
        {
            string args = string.Format("/end /tn \"{0}\" ", taskName);

            return(CommandExeHelper.Run(programName, args));
        }
Esempio n. 7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="taskName">任务计划名</param>
        /// <returns></returns>
        public static string Delete(string taskName)
        {
            string args = string.Format("/delete /tn \"{0}\" /F", taskName);

            return(CommandExeHelper.Run(programName, args));
        }
Esempio n. 8
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="taskName">任务计划名</param>
        /// <param name="taskPath">程序位置</param>
        /// <returns></returns>
        public static string Create(string taskName, string taskPath)
        {
            string args = string.Format("/Create /RU system /TN {0} /SC ONSTART /TR \"{1}\" /F", taskName, taskPath);

            return(CommandExeHelper.Run(programName, args));
        }