C#直接操作并口
2010-11-12 08:20:23 来源:WEB开发网核心提示: int handle = CreateFile( "lpt1 ", 0x40000000, 0, 0, 3 /**//*OPEN_EXISTING*/, 0, 0); if (handle != 0) { WriteFile(handle, sendData, strLen, ref a
int handle = CreateFile( "lpt1 ", 0x40000000, 0, 0, 3 /**//*OPEN_EXISTING*/, 0, 0);
if (handle != 0) {
WriteFile(handle, sendData, strLen, ref aLen, 0);
CloseHandle(handle); //注意,只有关闭并口后打印机才执行命令
if (handle != 0) {
WriteFile(handle, sendData, strLen, ref aLen, 0);
CloseHandle(handle); //注意,只有关闭并口后打印机才执行命令
更多精彩
赞助商链接