问下大家.net在做串口通信方面怎么样?
比如说POS机与PC机之间的通信
我用.NET做PC端后台管理与POS机之间通信 好实现吗?
小弟对串口通信不懂啊 这次没办法要接触
比如说POS机与PC机之间的通信
我用.NET做PC端后台管理与POS机之间通信 好实现吗?
小弟对串口通信不懂啊 这次没办法要接触
解决方案 »
- webbrowse刷新网页的问题
- 如何为ComboBox设置ToolTip啊?(急啊)
- 如何让DataGridView内数据为负数时候自动显示为红色
- 主程序引用编译的dll类库后,结束时进程不能结束
- 请教高手:从dataTable 导出数据生成dbf文件时,如何自动设定dbf各列的长度及类型
- 以下代码是在VB.NET中实现繁简体转换的,请问如何在C#中实现,谢谢!
- 如何取出数据库最新值
- TextBox控件的OnTextChanged事件
- 编程的时候怎么体现出数据库的约束啊。
- 求救--!.net没法调试!!!!!
- BULK INSERT 大批量插入时如果只碰到少量错误,怎么能让db.ExecuteCommand(mycmd)不报错?
- 用vs c#做网页浏览器!
and doesn't support direct port access.
My Serial Port FAQ:
.NET 1.0 has no support for legacy ports (COM/LPT).
There are plans to add support for serial ports in a future version:
http://groups.google.com/groups?&selm=O%23vQLn9bCHA.392%40tkmsftngp09
"this sample is very similar to what we will be adding" :
http://www.gotdotnet.com/userarea/filedetails.aspx?FileName=SerialPort.zip
(note, project built with beta VS.NET, read gotdotnet comments)
With 1.0 you have to use PInvoke or Interop :
First understand the Win32 API as described here (C++):
http://msdn.microsoft.com/library/en-us/dnfiles/html/msdn_serial.asp
New MSDN article for .NET (mostly C#):
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/
PInvoke samples for C#:
http://www.gotdotnet.com/userarea/filedetails.aspx?FileName=SerialPort.zip
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/
or for VB.NET:
http://msdn.microsoft.com/library/en-us/dnvssamp/html/vbcs_usingthecomportinvbnet.asp
My Parallel Port FAQ:
If you have to send raw data to a printer:
HOW TO: Send Raw Data to a Printer by Using Visual C# .NET :
http://support.microsoft.com/?kbid=322091
If you want to control the port pins:
You have to install some kind of hardware drivers!
(Warning: will impact system security/reliability)
for .NET : TSIO (generic IO)
www.thoroughsoft.com
http://65.184.102.81/thoroughsoft/products/Products_TSIO/Products_TSIO.aspx
commercial, specific for printer ports, e.g.:
http://www.zealsoftstudio.com/ntport/download.html
http://www.ntport.com/
C++/Win32
http://www.entechtaiwan.com/tviclpt.htm
http://www.internals.com/
For more information about ports, check this sites:
http://www.lvr.com/parport.htm
http://www.beyondlogic.org
My USB Port FAQ:
USB is a hardware bus and as such not directly exposed
to user-mode (Win32) applications (or even .NET).
Only Windows device-drivers do control the USB.
=> get a driver from manufacturer.
So if you connect a printer with USB, use the Win32/.NET printer-API.
Or if you connect a modem with USB, use the Win32 serial-API.
Or if you connect an imaging device (camera/scanner), use TWAIN/WIA.
If you want to design your own external, USB compliant hardware,
you have to understand the USB bus protocol
and implement a controller chip.
Then on Windows side, you have to write your own
device driver with the Windows DDK.
Sure there are OEM kits making all this easier.
Please visit sites like:
http://www.usb.org/
http://www.microsoft.com/hwdev/bus/USB/
http://www.lvr.com/usb.htm
http://www.beyondlogic.org
and learn the technology.
SerialPort.Write() //用于向串口写入数据,即发送数据到串口。
是不是效率上有不同?