通过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

相关推荐
DowneyJoy20 分钟前
【多媒体交互】透明无边框窗口
unity·c#·.net·交互
CreasyChan29 分钟前
Unity GC实战优化总结
unity·c#
玩泥巴的29 分钟前
深入理解飞书 Webhook 签名验证:一次踩坑到填坑的完整记录
c#·.net·飞书
JoyCong19983 小时前
ToDesk企业版助力图达通智能科技驰骋智造新赛道
科技·远程工作·远程操作
FuckPatience4 小时前
C# SqlSugar+SQLite: 无法加载 DLL“e_sqlite3”: 找不到指定的模块
开发语言·c#
HelloRevit5 小时前
Windows Server SMB 共享文件 回收站
windows·c#
曹牧5 小时前
C#:ToDouble
开发语言·c#
yongui478345 小时前
使用C#实现Excel实时读取并导入SQL数据库
数据库·c#·excel
阿蒙Amon6 小时前
C#每日面试题-简述匿名方法
java·面试·c#
波波0077 小时前
C# 中静态类的正确与错误用法
c#