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

相关推荐
jllllyuz16 分钟前
C# 面向对象图书管理系统
android·开发语言·c#
wuguan_18 分钟前
C#文件读取
开发语言·c#·数据读写
hoiii18718 分钟前
基于C#的PLC串口通信实现
开发语言·c#·plc
rabbitlzx21 分钟前
《Async in C# 5.0》第七章 异步代码工具集
c#·asynchronous
csdn_aspnet1 小时前
C# 结合 JavaScript 实现手写板签名并上传到服务器
javascript·c#
我不是程序猿儿1 小时前
【C#】软件设计,华为的IPD学习之需求开发心得
学习·华为·c#
WebRuntime2 小时前
所有64位WinForm应用都是Chromium浏览器
javascript·c++·c#·.net·web
superman超哥2 小时前
仓颉Union类型的定义与应用深度解析
开发语言·后端·python·c#·仓颉
唐青枫2 小时前
C#.NET 索引器完全解析:语法、场景与最佳实践
c#·.net
MyBFuture12 小时前
C#接口与抽象类:关键区别详解
开发语言·c#·visual studio