读写并口报外部组件异常,怎么回事?
程序如下: (Inpout32.dll已经放到system目录下)
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);
}
PortAccess.Input( 888 );//从888(即0x378)端口读取数据
PortAccess.Output( 888, 4 )//把4从888端口输出
------解决方案--------------------gz