예제 #1
0
        internal IpcClientImpl()
        {
            var token = Guid.NewGuid().ToString();
            var currentAssemblyPath          = Assembly.GetExecutingAssembly().Location;
            var currentAssemblyDirectoryPath = Path.GetDirectoryName(currentAssemblyPath);
            var clientPath = Path.Combine(currentAssemblyDirectoryPath, "Warewolf.COMIPC.exe");
            var psi        = new ProcessStartInfo(clientPath, token)
            {
                Verb                   = "runas",
                UseShellExecute        = false,
                ErrorDialog            = false,
                RedirectStandardOutput = false,
                CreateNoWindow         = true
            };

            _process     = Process.Start(psi);
            _pipeWrapper = new NamedPipeClientStreamWrapper(".", token, PipeDirection.InOut);
            _pipeWrapper.Connect();
        }
예제 #2
0
        private IpcClient()
        {
            string token = Guid.NewGuid().ToString();

            // Pass token to child process
            var psi = new ProcessStartInfo("WarewolfCOMIPC.exe", token)
            {
                Verb                   = "runas",
                UseShellExecute        = false,
                ErrorDialog            = false,
                RedirectStandardOutput = false,
                CreateNoWindow         = true
            };

            _process     = Process.Start(psi);
            _pipeWrapper = new NamedPipeClientStreamWrapper(".", token, PipeDirection.InOut);
            _pipeWrapper.Connect();

            _pipeWrapper.ReadMode = PipeTransmissionMode.Message;
        }