Exemplo n.º 1
0
        private static UVncOption InitialVncPath()
        {
            var option = new UVncOption();

            if (File.Exists(_winvnc) && File.Exists(_setpasswd) && File.Exists(_ultravncIni))
            {
                option.WinvncExe         = _winvnc;
                option.SetpasswordExe    = _setpasswd;
                option.UltravncIni       = _ultravncIni;
                option.VncServiceName    = _vncServiceName;
                option.WinVncProcessName = _vncProcessName;
                return(option);
            }

            if (File.Exists(_winvncX86) && File.Exists(_setpasswdX86) && File.Exists(_ultravncIniX86))
            {
                option.WinvncExe         = _winvncX86;
                option.SetpasswordExe    = _setpasswdX86;
                option.UltravncIni       = _ultravncIniX86;
                option.VncServiceName    = _vncServiceName;
                option.WinVncProcessName = _vncProcessName;
                return(option);
            }

            return(InitialVncPathUseEmbed());
        }
Exemplo n.º 2
0
 public UVncBase(UVncOption option)
 {
     _vncServiceName    = option.VncServiceName;
     _winvncProcessName = option.WinVncProcessName;
     _winvncExe         = option.WinvncExe;
     _setpasswordExe    = option.SetpasswordExe;
     _ultravncIni       = option.UltravncIni;
 }
Exemplo n.º 3
0
        protected bool InvokeValidateAccountOrOpenInputAccountBox()
        {
            if (UVncOption.ValidateInputAccount())
            {
                return(true);
            }

            if (ValidateAccountOrOpenInputAccountBox != null)
            {
                if (ValidateAccountOrOpenInputAccountBox.Invoke(null, null))
                {
                    UVncOption.CreateAndWriteAdminPasswdToUserTempFile();
                    return(true);
                }
                return(false);
            }
            else
            {
                throw new Exception("用戶輸入框事件未訂閱.");
            }
        }
Exemplo n.º 4
0
        protected bool InvokeValidateAccountOrOpenInputAccountBox()
        {
            if (UVncOption.ValidateInputAccount())
            {
                return true;
            }

            if (ValidateAccountOrOpenInputAccountBox != null)
            {
                if (ValidateAccountOrOpenInputAccountBox.Invoke(null, null))
                {
                    UVncOption.WriteAdminInfoToTempAdminTxt();
                    return true;
                }
                return false;
            }
            else
            {
                throw new Exception("用戶輸入框事件未訂閱.");
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 嵌入資源 "winvnc.exe","ultravnc.ini" 寫入 temp 文件夾
        /// </summary>
        /// <returns></returns>
        private static UVncOption InitialVncPathUseEmbed()
        {
            var tempWinvnc = Path.Combine(_TempFolder, "winvnc.exe");
            var tempIni    = Path.Combine(_TempFolder, "ultravnc.ini");

            var option = new UVncOption
            {
                WinvncExe         = tempWinvnc,
                UltravncIni       = tempIni,
                VncServiceName    = _vncServiceName,
                WinVncProcessName = _vncProcessName
            };

            if (File.Exists(tempWinvnc))
            {
                return(option);
            }

            File.WriteAllBytes(tempWinvnc, VncHelperLib.Properties.Resources.winvnc);
            File.WriteAllText(tempIni, VncHelperLib.Properties.Resources.UltraVNC);

            return(option);
        }
Exemplo n.º 6
0
 public UVncAsAdmin(UVncOption option) : base(option)
 {
 }
Exemplo n.º 7
0
 public UVncNonAdmin(UVncOption option) : base(option)
 {
 }