使用 c++ 与端口通信或者c#?
我开始编写一个与串行/并行端口通信的程序。我不确定我应该用 C# 还是 C++ 来编写它。
我更喜欢 C#,因为它是我的首选语言,并且我用它编写了应用程序(高级)。但我不确定它是否可以在所有情况下处理端口通信。 (例如,有一次我想开发一个过滤器驱动程序,但发现使用 C# 根本无法完成。所以我也对端口编程限制表示怀疑。)通常在这些情况下人们会使用 C++。 (为什么?)关于这个问题,我应该注意 C# 中的任何限制吗?
I'm starting to write a program which communicates with serial/parallel ports. I'm not sure whether I should write it with C# or C++.
I prefer C# because it's my preferred language and I have written applications (high level) with it. But I'm not sure if it can handle port communication in all circumstances. (For example once I wanted to develop a filter driver and found out it couldn't be done at all using C#. So I'm in doubt about port programming limitations as well.) Usually people go with C++ in these situations. (why?) Is there any limitations in C# I should be aware of regarding this matter?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您需要对端口进行精细控制(即位爆炸和发送原始数据的能力),因此您需要一个额外的组件来在 .NET 中执行此操作。有关示例,请参阅 http://www.lvr.com/parport.htm。
没有托管方法可以做到这一点,但通过使用外部组件,您可以在熟悉的环境中进行开发。这可能是要走的路,因为直接处理端口是一个耗时的过程。
Since you need fine control over the port (ie, the ability to bit-bang and send raw data), then you need an extra component to do this in .NET. See http://www.lvr.com/parport.htm for an example.
There is no managed way to do this, but by using external components, you can develop in your familiar environment. This is probably the way to go, since dealing directly with ports is a life-consuming process.