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

相关推荐
cici158741 小时前
C#实现三菱PLC通信
java·网络·c#
CreasyChan4 小时前
Unity Shader 入门指南
unity·c#·游戏引擎·shader
ysdysyn5 小时前
C# Modbus RTU 多从站控制全攻略:一端口,双轴控制
开发语言·c#·mvvm·通讯·modbus rtu
TypingLearn6 小时前
2026年,让.NET再次伟大
windows·c#·.net·sdk·netcore
ServBay7 小时前
.NET 10 与 C# 14 更新速览,代码更少,性能更好
后端·c#·.net
玩泥巴的9 小时前
如何设计易维护、低学习成本的飞书.NET SDK组件
c#·二次开发·飞书·roslyn
串流游戏联盟10 小时前
永劫无间新模式更新!低配手机怎么玩?
游戏·远程工作
Fighting_p10 小时前
【预览word文档】使用插件 docx-preview 预览线上 word 文档
开发语言·c#·word
袁煦丞 cpolar内网穿透实验室12 小时前
无需公网 IP 也能全球访问本地服务?cpolar+Spring Boot+Vue应用实践!
vue.js·spring boot·tcp/ip·远程工作·内网穿透·cpolar
jiushidt13 小时前
Things About ArcGISPro
arcgis·c#·.net·arcgispro