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端口输出

相关文章:

  • 2022-12-23
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-11
  • 2022-12-23
  • 2021-07-03
  • 2021-04-27
  • 2021-07-28
  • 2022-12-23
相关资源
相似解决方案