/// <summary> 开启C#版VNC服务 </summary> public static void StartVncService() { RemoteViewService remoteViewService = RemoteViewService.GetVncService(); remoteViewService.ServicePort = Port; remoteViewService.Password = Password; remoteViewService.BacklogMaxCount = 2; if (!remoteViewService.IsVncServiceRun) { remoteViewService.StartListener(); } }
public static RemoteViewService GetVncService() { if (_singleton == null) { lock (SyncRoot) { if (_singleton == null) { _singleton = new RemoteViewService(); } } } return(_singleton); }
/// <summary> 关闭C#版VNC服务 </summary> public static void CloseVncService() { RemoteViewService remoteViewService = RemoteViewService.GetVncService(); remoteViewService.StopListener(); }