Beispiel #1
0
        //public void SetPasswordToUltraVNCini(string password)
        //{
        //    var cmd = new CMDHelper();
        //    cmd.CreateProcessExe(_setpasswordExe, password + " " + password);
        //}
        #endregion

        #region CreateWinVncProcess
        public void CreateWinVncProcessWait(int waitSecond)
        {
            if (!WinVncProcessExist())
            {
                var cmd = new CMDHelper();
                cmd.CreateProcessExe(_winvncExe, "-run");

                for (int i = 0; i < waitSecond; i++)
                {
                    Thread.Sleep(1000);
                    if (WinVncProcessExist())
                    {
                        return;
                    }
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 刪除 uvnc_service 服務
        /// </summary>
        /// <param name="waitSecond">等待秒數</param>
        /// <returns></returns>
        public bool UninstallVncServiceWait_Authorize(int waitSecond)
        {
            if (VncServiceExist())
            {
                StopVncService_Authorize();
                var cmd = new CMDHelper();
                if (cmd.CreateProcessExe(_winvncExe, "-uninstallhelper"))
                {
                    for (int i = 0; i < waitSecond; i++)
                    {
                        Thread.Sleep(1000);
                        if (!VncServiceExist())
                        {
                            return(true);
                        }
                    }
                }
                return(false);
            }

            return(true);
        }