通过CMD快速安装VNC服务器,无ico

private void InstallVNC(string msifullpath,string password="vdsm")

{

try

{

string serviceName = "tvnserver";

ServiceController[] services = ServiceController.GetServices();

bool serviceExists = services.Any(s => s.ServiceName == serviceName);

if (serviceExists)

{

WriteTipInfo("远程服务已存在,跳过自动部署!", Color.Blue);

}

else

{

WriteTipInfo("远程服务未安装,即将自动部署", Color.Blue);

string cmd = string.Format("msiexec.exe /i \"{0}\" /norestart /qn SET_USEVNCAUTHENTICATION=1 VALUE_OF_USEVNCAUTHENTICATION=1 SET_PASSWORD=1 VALUE_OF_PASSWORD={1} SET_VIEWONLYPASSWORD=1 VALUE_OF_VIEWONLYPASSWORD={1} SET_USECONTROLAUTHENTICATION=1 VALUE_OF_USECONTROLAUTHENTICATION=1 SET_CONTROLPASSWORD=1 VALUE_OF_CONTROLPASSWORD={1} SET_RUNCONTROLINTERFACE=1 VALUE_OF_RUNCONTROLINTERFACE=0", msifullpath, password);

File.WriteAllText("InsertRemote.bat", cmd);

Process.Start("InsertRemote.bat");

WriteTipInfo("远程服务的执行自动安装完成!", Color.Blue);

}

}

catch (Exception err)

{

WriteTipInfo("远程服务自动安装过程出现异常:"+err.Message, Color.Red);

}

}

各安装配置命令见PDF:https://www.tightvnc.com/doc/win/TightVNC_2.7_for_Windows_Installing_from_MSI_Packages.pdf

相关推荐
MaoziShan13 小时前
CMU Subword Modeling | 09 Lexemes, or What Dictionaries Know about Morphology
开发语言·人工智能·机器学习·语言模型·自然语言处理·c#
游乐码13 小时前
c#选择排序
c#·排序算法
listhi52015 小时前
基于C#实现动态人脸检测
开发语言·c#
rabbitlzx18 小时前
《Async in C# 5.0》第十四章 深入探讨编译器对于async的转换
java·开发语言·c#·异步·asynchronous
智商偏低18 小时前
unity 如何渲染大场景
c#
光泽雨20 小时前
单例模式代码理解
开发语言·c#
软泡芙1 天前
【C#】一个原始的标准蓝牙心率血氧服务的数据:字节数组byte[]有5个数据分别的0、0、240、0、240,转成IEEE 11073 SFLOAT
c#
gc_22991 天前
C#学习调用OpenMcdf模块解析ole数据的基本用法(2)
c#·ole·openmcdf·offvis软件
bugcome_com1 天前
C# 变量详解(从入门到掌握)
c#
kylezhao20192 天前
C#中如何防止序列化文件丢失和损坏
c#