设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> 网络编程 >> .net >> C#封装的一个串口操作类(可用于Win CE)
精品推荐
.net点击TOP10
·CHK文件恢复工具
·.NET 初 级 读 本
·『原创』C#中TreeView类操作全攻略:建立树,新增节点,删除节点,修改节点,拖动节点,与Oracle数据库交互操作(一)
·我的.NET书架 (入门篇)
·从零开始学ASP.NET(基础篇)
·官方水晶报表 .NET 应用程序实例下载 (C#、Visual C++.NET)
·给 OpenPOP.Net 加一个小功能,可用于收取邮件时监测数据流量!
·.NET:是什么?将走向哪里?
·P2P之UDP穿透NAT的原理与C#实现
·动网论坛灌水机
网络编程点击TOP10
·ASP.NET 程序中常用的三十三种代码
·CHK文件恢复工具
·.NET 初 级 读 本
·c#操作word表格
·『原创』C#中TreeView类操作全攻略:建立树,新增节点,删除节点,修改节点,拖动节点,与Oracle数据库交互操作(一)
·我的.NET书架 (入门篇)
·十天学会ASP.net之第一天
·从零开始学ASP.NET(基础篇)
·用C#实现木马程序
·官方水晶报表 .NET 应用程序实例下载 (C#、Visual C++.NET)
精选专题

C#封装的一个串口操作类(可用于Win CE)

作者: 来源:网络文章 时间:2005-12-13 18:45:14

C#封装的一个串口操作类(可用于Win CE)(1)

using System;
using System.Runtime.InteropServices;

namespace NativeDll
{
 /// <summary>
 /// SerialPort 的摘要说明。
 /// </summary>
 public class SerialPort
 {
  #region 申明要引用的和串口调用有关的API
  //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;
  private const int MAXBLOCK = 4096;

  private const uint PURGE_TXABORT = 0x0001;  // Kill the pending/current writes to the comm port.
  private const uint PURGE_RXABORT = 0x0002;  // Kill the pending/current reads to the comm port.
  private const uint PURGE_TXCLEAR = 0x0004;  // Kill the transmit queue if there.
  private const uint PURGE_RXCLEAR = 0x0008;  // Kill the typeahead buffer if there.
      
  [StrUCtLayout(LayoutKind.Sequential)]
   private struct DCB 
  {
   //taken from c struct in platform sdk 
   public int DCBlength;           // sizeof(DCB) 
   public int BaudRate;            // current baud rate 
   public int fBinary;          // binary mode, no EOF check 
   public int fParity;          // enable parity checking 
   public int fOutxCtsFlow;      // CTS output flow control 

共12页 9 7 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [128 :>

C#封装的一个串口操作类(可用于Win CE) 相关文章:
C#封装的一个串口操作类(可用于Win CE) 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com