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()); }
public UVncBase(UVncOption option) { _vncServiceName = option.VncServiceName; _winvncProcessName = option.WinVncProcessName; _winvncExe = option.WinvncExe; _setpasswordExe = option.SetpasswordExe; _ultravncIni = option.UltravncIni; }
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("用戶輸入框事件未訂閱."); } }
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("用戶輸入框事件未訂閱."); } }
/// <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); }
public UVncAsAdmin(UVncOption option) : base(option) { }
public UVncNonAdmin(UVncOption option) : base(option) { }