简单的IPC机制的C#/ WPF应用程序来实现应用的CLI [英] simple IPC mechanism for C#/WPF application to implement app CLI

查看:391
本文介绍了简单的IPC机制的C#/ WPF应用程序来实现应用的CLI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我一直在阅读大量有关的.Net进程间通信。命名管道,远程处理。这一切似乎很大,但有可能矫枉过正什么,我需要做的。

So I've been reading lots about interprocess communication on .Net. Named pipes, remoting. It all seems great but possibly overkill for what I need to do.

我要添加一个命令行界面,以我的WPF应用程序,所以我需要一个简单的IPC机制来从一个进程发送字符串到已运行的应用程序。

I want to add a command line interface to my WPF application, so I need a simple IPC mechanism to send the string from one process to the already running app.

什么是SO建议这样做?

What does SO recommend for doing so?

推荐答案

NamedPipeClientStream NamedPipeServerStream 是pretty的简单。 <一href="http://web.archive.org/web/20080516173418/http://www.flawless$c$c.com/post/2008/02/Enforcing-single-instance-with-argument-passing.aspx"相对=nofollow>这里的pretty的简单例子,其中IPC用于从应用程序到另一个的一个实例传递的命令行参数。这不正是你想做的事,但pretty的接近。

NamedPipeClientStream and NamedPipeServerStream are pretty simple. Here's a pretty simple example where IPC is used to pass command line arguments from one instance of an application to another. It's not exactly what you want to do, but pretty close.

这篇关于简单的IPC机制的C#/ WPF应用程序来实现应用的CLI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆