| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1465 人关注过本帖
标题:并口操作
只看楼主 加入收藏
xhyc
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2009-8-31
收藏
 问题点数:0 回复次数:0 
并口操作
请问各位高手,我用INPOUT32.DLL 操作并口时出现“外部组件发生异常”,代码如下:
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsApplication2
{
    public partial class Form1 : Form
    {
        [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);
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
        }
        private void button1_Click(object sender, EventArgs e)
        {  
           
           Input( 888 );//从888(即0x378)端口读取数据
           Output(888, 4);//把4从888端口输出 0 0 0
           
         
        }
    }
 

}
请问是怎么回事?多谢!
搜索更多相关主题的帖子: 并口 
2009-08-31 15:34
快速回复:并口操作
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022678 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved