Communicating with ports with c++ or c#?
I'm starting to write a program which communicates 开发者_StackOverflow社区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?
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.
精彩评论