Пример #1
0
        static void Main(string[] args)
        {
            WinDX.DXExec dx = new DXExec();
            if (dx.isExecOnly())
            {
                dx.Start();
            }
            else
            {
                string[] addargs = { "-execonly" };
                dx.StartThread(addargs);
                WinDXL.DXLink dxl = new DXLink();
                if (dxl.ConnectToRunningServer(1900))
                {
                    dxl.RegisterErrorHandler();
                    Console.WriteLine("Connected to Server");
                    if (dxl.LoadVisualProgram("C:/Progra~1/OpenDX/samples/programs/AutoColor.net") == DXLink.OK)
                        if (dxl.ExecuteOnce() == DXLink.OK)
                        {
                            SyncAfterExecute(ref dxl);
                            MessageBox.Show("Image Displayed.", "Hold",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                            dxl.CloseConnection();
                        }

                }
                else
                    Console.WriteLine("Didn't connect to Server");

            }
        }
Пример #2
0
        private int ConnectTo(String host, String user, String cwd, String[] av, ref String errstr)
        {
            if (!HostIsLocal(host))
                throw new Exception("Remote hosting not yet available.");

            if (user != null)
                Console.WriteLine("Different user on local machine ignored.");

            dxexec = new DXExec();
            try
            {
                child = (int) dxexec.StartThread(av);
            }
            catch (Exception)
            {
                errstr = "Unable to start Exec.";
                return (-1);
            }

            return child;
        }