如何通过一些"统计"从C#程序到另一个程序? [英] how to pass some "statistics" from c# program to another program?

查看:104
本文介绍了如何通过一些"统计"从C#程序到另一个程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的命令行程序,做了很多工作,生产了大量的统计数据。这是股市的交易软件延误,错误,不管相当关键,所以我不想GUI添加到它。 (GUI而且有时是必需的,但控制台应用程序应始终启动)

I have command-line program that "do a lot of work" and produce "a lot of statistics". It's stocks trading software pretty critical to delays, bugs, and whatever, so I don't want to add GUI to it. (moreover GUI is required sometimes, but console application should be always launched)

我需要图形用户界面友好的显示收集的统计(以只读模式)。如何传输的统计数据?这将足以刷新它的每一秒。我需要的可能是通过网络来​​一束从一个控制台C#程序的数据传送到另一个GUI(可能不是C#)计划,在未来,但当地现在。

I need GUI to friendly display collected statistic (in read-only mode). How to transfer that statistics? It would be enough to refresh it every second. I need to transfer bunch of data from one console c# program to another GUI (probably not c#) program, in future probably by network, but locally for now.

统计是像传感器数据,测量每一秒。有很多的传感器(几百个)的。 (在现实世界是有很多不同的值,如利润等每秒订单。)

Statistics is like "sensors data", measured every second. There are a lot of (hundreds) of sensors. (in real word it's a lot of different values, like "profit", "orders per second" etc.)

我应该使用纯文本文件,数据库或成才else和怎么样?

Should I use plain file, db or someting else and how?

推荐答案

您可以使用任何形式的IPC(进程间通信)的。

You can use any form of IPC (inter-process communication).

既然你打算去通过网络在未来,我建议WCF。如果GUI程序也不是.NET,那么你可能需要使用较低级别的解决方案,如命名管道或插座。

Since you're planning to go over the network in the future, I recommend WCF. If the GUI program isn't .NET, then you may need to use a lower-level solution, such as named pipes or sockets.

这篇关于如何通过一些"统计"从C#程序到另一个程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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