using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }        private void Form1_Load(object sender, EventArgs e)
        {
            if (this.serialPort1.IsOpen == false)
            {
                this.serialPort1.Open();
            }
        }        private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
        {
            this.textBox1.Text = this.serialPort1.ReadLine(); ;
        }        private void button1_Click(object sender, EventArgs e)
        {
            if (this.serialPort1.IsOpen == true)
            {
                this.serialPort1.Close();
            }
            this.Close();
        }
    }
}

解决方案 »

  1.   

    我曾经在VS 2003下开发过PDA串口通信,没有问题,看起来你使用的串口访问类库和我的好像也是一样的。估计是设置或者插线的问题,请在这方面检查一下。
      

  2.   

    参数如下:baudrate:9600 databits:8 discardnull:false dtrenable:false handshake:none parity:none parityreplace:63 portname:com1 readbuffersize:1024 readtimeout:-1 receivedbytesthreshold:13 rtsenable:false stopbits:one writebuffersize:1024 writetimeout:-1 连接是没问题的 用的是EM读卡器 就是读不来东东
      

  3.   

    这个问题和硬件依赖性很强,这样说看不出什么问题,大概帮不上你什么忙了。
    sorry. :(