using system;
using system.runtime.interopservices;
namespace serial***m
public string portnum;
public int baudrate;
public byte bytesize;
public byte parity; // 0-4=no,odd,even,mark,space
public byte stopbits; // 0,1,2 = 1, 1.5, 2
public int readtimeout;
//***m port win32 file handle
private int h***m = -1;
public bool opened = false;
//win32 api constants
private const uint generic_read = 0x80000000;
private const uint generic_write = 0x40000000;
private const int open_existing = 3;
private const int invalid_handle_value = -1;
[structlayout(layoutkind.sequential)]
public struct dcb
[structlayout(layoutkind.sequential)]
private struct ***mtimeouts
private class hexcon
",inbyte);
}return stringout;
}public static byte stringtobyte(string instring)
return byteout;}}
}}
乙個目錄操作的類
學習mfc的過程中,建立了乙個目錄類來在操作目錄的時候進行有關目錄的相關操作 1.檢測目錄是否存在 2.建立目錄 3.從檔名中提取目錄名 4.強制建立目錄 5.去除檔名末尾 6.增加 到目錄名 以下 參照了delphi中vcl的有關 mfc中可能存在相關的類,但我沒有找到。如下 directory....
乙個好用的串列埠類(收發自如)
個串列埠通訊的類 ifndef commutils h define commutils h class commutils endif include stdafx.h include commutils.h include stdio.h const int read timeout 500 c...
串列埠操作類
using system using system.collections.generic using system.linq using system.text using system.io.ports namespace communicationcomm region 傳送接收資料 publ...