imports systemimports system.runtime.interopservices
#region "struct" 【程序编程相关:VB 二进制块读写类模块应用实例,包括一】
namespace justinio class commport public portnum as string public baudrate as integer public bytesize as byte public parity as byte // 0-4=no,odd,even,mark,space public stopbits as byte // 0,1,2 = 1, 1.5, 2 public readtimeout as integer //comm port win32 file handle private hcomm as integer = -1 public opened as boolean = false //win32 api constants private const generic_read as int64 = &h80000000 private const generic_write as int64 = &h40000000 private const open_existing as integer = 3 private const invalid_handle_value as integer = -1 【推荐阅读:[Klezard]插入符组件(Caret】
<structlayout(layoutkind.sequential)> _ public structure dcb //taken from c struct in platform sdk public dcblength as integer // sizeof(dcb) public baudrate as integer // 指定当前波特率 current baud rate // these are the c struct bit fields, bit twiddle flag to set public fbinary as integer // 指定是否允许二进制模式,在windows95中必须主true binary mode, no eof check public fparity as integer // 指定是否允许奇偶校验 enable parity checking public foutxctsflow as integer // 指定cts是否用于检测发送控制,当为true是cts为off,发送将被挂起.... 下一页