你可以研究一下这个东西,也许有你想要的。http://java.sun.com/products/javacomm/index.htmlThe JavaTM Communications API can be used to write platform-independent communications applications for technologies such as voice mail, fax, and smartcards. This version of the Java Communications API contains support for RS232 serial ports and IEEE 1284 parallel ports. With updated functionality, one can: Enumerate ports available on the system. 
Open and claim ownership of ports. 
Resolve port ownership contention between multiple applications. 
Perform asynchronous and synchronous I/O on ports. 
Receive Beans-style events describing communication port state changes. 

解决方案 »

  1.   

    高手,可以说说如何在判断write方法触发的事件是否结束,为下一个write方法提供机会
    就是主程序里有多个write方法,小妹这湘有礼哦 
      

  2.   

    但sleep的时间不知啊
    总不能对每一时间都进行试验吧
    谁能对PDU解码,使得发送中文字达到80,英文达到140,
    十万火急,高分赠送。
      

  3.   

    为什么用java?VC不是很好的?
      

  4.   

    create a buffer, wrtie your data to the buffer.
    and the buffer post your data to comm port.
      

  5.   

    mailtojack()兄台,那写进buffer后怎么让他触发事件啊?
      

  6.   

    用多个线程啊
    一个用来处理数据
    一个专门用来监听端口
    如果是专职的程序,可以用java.io.InputStream.available()方法返回可以
    读取的字符
    然后在一个while()循环里等待啊
    不知道小弟说的对不对?