4

我正在构建一个 Web 服务,为远程机器提供 VNC 连接。目前我正在使用一个名为 novnc 的项目将 VNC 嵌入到我的网页中的一个元素中。但是,它非常慢,尤其是 web 浏览器、eclipse 等。但是,当我尝试 novnc 发布的 VNC Viewer for Google Chrome webapp 时,它似乎真的很快。这可能是因为它正在运行本机(本机 VNC 客户端也非常灵活)。我想知道我是否可以让我的用户安装 Real VNC webapp,然后使用我指定的参数(主机、端口等)从我的网页调用它?基本上,我的网页负责管理这些虚拟机(保存、创建、克隆等),我想要一个快速实现的 VNC,我可以从浏览器内部(从我的网页)调用它。从我研究过的不同的,

4

1 回答 1

3

http://rogierg.blogspot.com/2007/03/run-vnc-and-rdp-from-hyperlinks.html中的这段代码可能对您有所帮助。

编辑以下文本以指向您的 VNC 并另存为 C:\Windows\VNC.js:

 var destination=(WScript.Arguments(0))
 var search='vnc://'
 //Modify the path to VNC Viewer!
 var vncexe='D:\\Apps\\VNC\\vncviewer.exe'
 //WScript.Echo(destination)
 destination=destination.replace(search, '')
 destination=destination.replace('/', '')
 var ws = new ActiveXObject("WScript.Shell")
 //WScript.Echo(vncexe + " " + destination)
 ws.Exec(vncexe + " " + destination)

将下一段文本另存为 VNC.reg 并双击:

 Windows Registry Editor Version 5.00
 [HKEY_CLASSES_ROOT\vnc]
 @="URL:VNC Connection"
 "URL Protocol"=""
 [HKEY_CLASSES_ROOT\vnc\DefaultIcon]
 @="C:\\WINDOWS\\System32\\mstsc.exe"
 [HKEY_CLASSES_ROOT\vnc\shell]
 [HKEY_CLASSES_ROOT\vnc\shell\open]
 [HKEY_CLASSES_ROOT\vnc\shell\open\command]
 @="wscript.exe C:\\WINDOWS\\vnc.js %1"
于 2014-11-19T23:11:40.943 回答