各位高手:利用C#怎样进行串行端口通信呢,比如用COM1口连接单片机,应用什么器件,怎样编程实现?望指教!

解决方案 »

  1.   

    我有一个完整的类库+一个sample。不是我写的:
    /*
     * Author: Marcus Lorentzon, 2001
     *         [email protected]
     * 
     * Freeware: Please do not remove this header
     * 
     * File: SerialStream.cs
     * 
     * Description: Implements a Stream for asynchronous
     *              transfers and COMM. Stream version.
     *
     * Version: 2.3
     * 
     */
      

  2.   

    #region Usingusing System;
    using System.IO;
    using System.Threading;
    using System.Runtime.InteropServices;
    using System.ComponentModel;#endregion Using
      

  3.   

    namespace LoMaN.IO { public class SerialStream : Stream {

    #region Attributes private IOCompletionCallback m_IOCompletionCallback;
    private IntPtr m_hFile = IntPtr.Zero;
    private string m_sPort;
    private bool m_bRead;
    private bool m_bWrite; #endregion Attributes
      

  4.   

    没用 c#写过,delphi做过.帮你up!
      

  5.   

    给你推荐一个网站,你可以看看
    www.gjwtech.com
      

  6.   

    太难帖了。给这个邮箱发信索取:[email protected]
      

  7.   

    谁有串口通信源代码?完整 C#版……
    本人急需学习……
    有的,请发至,[email protected]不胜感激!