查看完整版本: 请问C#.NET2005如何进行串口通讯编程啊?

tanghuawei 2008-6-11 09:30

请问C#.NET2005如何进行串口通讯编程啊?

有谁有相关例子吗?谢谢

没有你的城市 2008-6-11 10:57

c#写的串口通讯

using System; rTC f&o/V
using System.IO.Ports;
(IBR6Hw0h].IB;f using System.Windows.Forms;
PP8l;|'B -M,EiU^R/D l3@#h
namespace SPCoO/m L!A.nk~ `"o
{
'al ~-B ?     /// <summary>~[aa0aH G:Z
    /// 串口控制  
z oR*q6A!?(g\     /// </summary> };N"|4F-d
    public class PortControlzGvrx^Z
4PNy BTN"F:O
    {j$W"Y5Ohwz
        /// <summary>
l3E#sY:\         /// 定义一个串口类:G6Q'Yc*b-BGSsa
        /// </summary>{uz+IgTbHb
        private   SerialPort  MyPort;
Ld(V-bqB1yY
} qma-]\}         /// <summary>'Z{7MJl,q3Z)D
        /// 初始化类/LZ.?(Tk L5n@cO@+y
        /// </summary>x(d0iQ ?+Z KX~
        public PortControl()
xjQ%L+zS         {/W&^4\&c5k}.ux#T!A1H
            MyPort = new SerialPort();
nr?3bH6@-C(n             setup();^3[ pl0T
        }sg B9Y6]8` hu.G
        /// <summary>
6LJf}{'f\ ~         /// 直接使用给某个串口
'h0PN1`3i+i#v0~3g         /// </summary>
zvI,e/]8W         /// <param name="port">COM1,COM2

没有你的城市 2008-6-11 10:58

使用SerialPort类设计串口通讯程序

[url=http://hi.baidu.com/wilhelmwang/blog/item/7a9c751bbdc766d0ad6e75df.html]http://hi.baidu.com/wilhelmwang/blog/item/7a9c751bbdc766d0ad6e75df.html[/url]
页: [1]
查看完整版本: 请问C#.NET2005如何进行串口通讯编程啊?