private void InitVncServer() { vncWindow = new VncWindow() { Visibility = Visibility.Hidden }; //vncWindow.Show(); vncServer = new VncServer(vncWindow); }
public VncWindow(VncServer server, VncMonitor monitor, LocalMonitor destinationMonitor) { InitializeComponent(); Server = server; Monitor = monitor; DestinationMonitor = destinationMonitor; Loaded += VncWindow_Loaded; Closed += VncWindow_Closed; PreviewKeyDown += VncWindow_PreviewKeyDown; }
private VncServerManager() { vncWindow = new VncWindow() { Visibility = Visibility.Hidden }; vncWindow.Show(); vncServer = new VncServer(vncWindow); }
private void MonitorSelected(VncServer vncServer, VncMonitor vncMonitor, LocalMonitor localMonitor) { try { if (DataContext is VncMatrixViewModel vm) { vm.OpenMonitor(vncServer, vncMonitor, localMonitor); } } catch (Exception e) { MessageBox.Show($"{e}"); } }
static void Main() { try { var notifyIconInterface = new NotifyIconInterface(); var vncServer = new VncServer(Constants.VNC_PORT); vncServer.ErrorOccurred += VncServer_ErrorOccurred; Application.Run(); } catch (Exception ex) { ErrorBox.Show("CommandExecutor.Main", ex); } }
static void Main(string[] args) { VncServer s = new VncServer("1", 5900, "TestServer"); try { s.Start(); } catch (ArgumentNullException ex) { Console.WriteLine(ex.Message); return; } Console.ReadLine(); }
private static void Main(string[] args) { var s = new VncServer("", "a", 5901, 5900, "Ulterius VNC"); try { s.Start(); Console.Read(); s.Stop(); } catch (ArgumentNullException ex) { s.Stop(); return; } }
public void StopVncServer() { if (vncThread != null) { vncServer.Stop(); vncWindow.Close(); // It's important to null these things so the garbage collector // will free the dangling resources (sockets, threads, etc). // The nulls also trigger Start() to recreate the now-defunct objects vncWindow = null; vncThread = null; vncServer = null; GC.Collect(); GC.WaitForPendingFinalizers(); } }
private static void Main(string[] args) { var s = new VncServer("", "password", 5901, 5900, "VNC Client"); Thread thr = new Thread(new ThreadStart(startTunnel)); try { thr.Start(); s.Start(); Console.Read(); s.Stop(); } catch (ArgumentNullException ex) { s.Stop(); return; } }
internal static void StartVNCServer(Form form1) { try { #if useVNC if (Program.DBCon.getIniValue <Boolean>("Settings", "ActivateVNC", false.ToString(), false)) { VNCAppServer = new NVNC.VncServer("", "", 5901, 5900, "ED-IBE Remote", form1); VNCServerThread = new System.Threading.Thread(new System.Threading.ThreadStart(VNCAppServer.Start)); VNCServerThread.Start(); } #endif } catch (Exception ex) { Program.DBCon.setIniValue("Settings", "ActivateVNC", false.ToString()); throw new Exception("Error while starting VNC server", ex); } }
public void StartVncServer() { try { var settings = new Settings(); var vncProxyPort = settings.Read("Vnc", "VncProxyPort", 5901); var vncPort = settings.Read("Vnc", "VncPort", 5900); var vncPass = settings.Read("Vnc", "VncPass", ""); vncServer = new VncServer(vncPass, vncProxyPort, vncPort, "Ulterius VNC"); Task.Run(() => { vncServer.Start(); }); var endData = new { vncStarted = true, proxyPort = vncProxyPort, port = vncPort, message = "VNC Server Started" }; serializator.Serialize(_client, packet.endpoint, packet.syncKey, endData); } catch (ArgumentNullException) { vncServer?.Stop(); } }