Example #1
0
 private void InitVncServer()
 {
     vncWindow = new VncWindow()
     {
         Visibility = Visibility.Hidden
     };
     //vncWindow.Show();
     vncServer = new VncServer(vncWindow);
 }
Example #2
0
 public VncWindow(VncServer server, VncMonitor monitor, LocalMonitor destinationMonitor)
 {
     InitializeComponent();
     Server             = server;
     Monitor            = monitor;
     DestinationMonitor = destinationMonitor;
     Loaded            += VncWindow_Loaded;
     Closed            += VncWindow_Closed;
     PreviewKeyDown    += VncWindow_PreviewKeyDown;
 }
Example #3
0
        private VncServerManager()
        {
            vncWindow = new VncWindow()
            {
                Visibility = Visibility.Hidden
            };
            vncWindow.Show();

            vncServer = new VncServer(vncWindow);
        }
Example #4
0
 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}");
     }
 }
Example #5
0
 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);
     }
 }
Example #6
0
        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();
        }
Example #7
0
        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;
            }
        }
Example #8
0
        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();
            }
        }
Example #9
0
        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;
            }
        }
Example #10
0
        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);
            }
        }
Example #11
0
 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();
     }
 }