C#并口操作
2024-09-28 17:50:39
using System;
using System.Runtime.InteropServices;
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint="Inp32")]
public static extern int Input(int adress);
}
//Output函数为给端口传送数据,Input是从端口读取数据 如:
PortAccess.Input( 888 );//从888(即0x378)端口读取数据
PortAccess.Output( 888, 4 )//把4从888端口输出
最新文章
- JDK自带工具列表
- push submodule
- Java命令提示符编译
- CodeForces - 420A (字符对称问题)
- 使用MediaPlayer播放音频-----之一
- 1709. Penguin-Avia(并查集)
- 经验之巧妙的应用Map
- ajax jquery return没有返回值
- 移动app接口编程技术-学习实现之PHP进阶 数组
- HDU 4247 A Famous ICPC Team
- JavaScript中return的用法和this的用法详解
- <;魔域>;按键精灵脚本
- MySQL CURTIME() 函数
- Html.ActionLink与Url.Action区别
- [P1879][USACO06NOV]玉米田Corn Fields (状态压缩)
- Linux命令(十八) 压缩或解压缩文件和目录 gzip gunzip
- MVC扩展生成CheckBoxList并水平排列
- OK335xS 256M 512M nand flash make ubifs hacking
- Python学习笔记(二)--变量和数据类型
- eslint 错误
热门文章
- js之10天内免登陆
- Redis学习总结之三——Redis客户端命令
- BD09坐标(百度坐标) WGS84(GPS坐标) GCJ02(国测局坐标) 的相互转换
- BZOJ4987:Tree (树形DP)
- BZOJ1026 SCOI2009 windy数 【数位DP】
- 《selenium2 python 自动化测试实战》(15)——调用js控制滚动条等操作
- direct2D图片处理
- iOS App多语言国际化
- OpenStack_Swift源代码分析——Ring的rebalance算法源代码具体分析
- oralce之 10046对Hash Join分析