• 大小: 499KB
    文件类型: .rar
    金币: 2
    下载: 1 次
    发布日期: 2021-05-08
  • 语言: C#
  • 标签: c#  并口  

资源简介

c#对并口的读写操作! INPOUT32.DLL using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace IED_Application { public partial class IED : Form { //int led=0x278; [DllImport("inpout32.dll", EntryPoint = "Out32")] public static extern void Output(int adress, int value); [DllImport("user32.dll", EntryPoint = "MessageBoxA")] public static extern void MsgBox(int hWnd, string msg, string caption, int type); public IED() { InitializeComponent(); } private void IED_Load(object sender, EventArgs e) { } private void output_Click(object sender, EventArgs e) { MsgBox(0, "这里是用DllImport", "tiaozhanbei", 0x30); IED.Output(888, 253); } } }

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;


namespace IED_Application
{
   public partial class IED : Form
    {
        //int led=0x278;


       [DllImport(“inpout32.dll“ EntryPoint = “Out32“)]
       public static extern void Output(int adress int value);
       
       [DllImport(“user32.dll“ EntryPoint = “MessageBoxA“)]
       public static extern void MsgBox(int hWnd string msg string caption int type);
       
       public IED()
        {
            InitializeComponent();
        }

       private void IED_Load(object sender EventArgs e)
        {

        }
       
       private void output_Click(object sender EventArgs e)
        {
            MsgBox(0 “这里是用DllImport“ “tiaozhanbei“ 0x30);
            IED.Output(888 253);
        }


    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      40171  2008-05-26 14:41  C#并口操作\dll_pic.jpg

     文件      73728  2010-11-27 21:57  C#并口操作\IED Application\IED Application\bin\Debug\IED Application.exe

     文件      30208  2010-11-27 21:57  C#并口操作\IED Application\IED Application\bin\Debug\IED Application.pdb

     文件      14328  2010-12-26 18:23  C#并口操作\IED Application\IED Application\bin\Debug\IED Application.vshost.exe

     文件        490  2007-07-21 02:33  C#并口操作\IED Application\IED Application\bin\Debug\IED Application.vshost.exe.manifest

     文件      73728  2010-11-27 21:22  C#并口操作\IED Application\IED Application\bin\Release\IED Application.exe

     文件      19968  2010-11-27 21:22  C#并口操作\IED Application\IED Application\bin\Release\IED Application.pdb

     文件       5473  2010-11-27 13:22  C#并口操作\IED Application\IED Application\IED Application.csproj

     文件        533  2010-11-25 22:22  C#并口操作\IED Application\IED Application\IED Application.csproj.user

     文件       1009  2010-11-27 21:57  C#并口操作\IED Application\IED Application\IED.cs

     文件       2407  2010-11-27 18:57  C#并口操作\IED Application\IED Application\IED.Designer.cs

     文件      54200  2010-11-27 18:57  C#并口操作\IED Application\IED Application\IED.resx

     文件      27648  2004-01-23 03:47  C#并口操作\IED Application\IED Application\INPOUT32.DLL

     文件      32054  2002-01-25 16:11  C#并口操作\IED Application\IED Application\Install.ico

     文件       1916  2010-12-26 18:23  C#并口操作\IED Application\IED Application\obj\Debug\IED Application.csproj.FileListAbsolute.txt

     文件        845  2010-11-27 18:57  C#并口操作\IED Application\IED Application\obj\Debug\IED Application.csproj.GenerateResource.Cache

     文件      73728  2010-11-27 21:57  C#并口操作\IED Application\IED Application\obj\Debug\IED Application.exe

     文件      30208  2010-11-27 21:57  C#并口操作\IED Application\IED Application\obj\Debug\IED Application.pdb

     文件      32620  2010-11-27 18:57  C#并口操作\IED Application\IED Application\obj\Debug\IED_Application.IED.resources

     文件        180  2010-11-27 13:24  C#并口操作\IED Application\IED Application\obj\Debug\IED_Application.Properties.Resources.resources

     文件       1948  2010-11-27 21:29  C#并口操作\IED Application\IED Application\obj\Release\IED Application.csproj.FileListAbsolute.txt

     文件        845  2010-11-27 19:02  C#并口操作\IED Application\IED Application\obj\Release\IED Application.csproj.GenerateResource.Cache

     文件      73728  2010-11-27 21:22  C#并口操作\IED Application\IED Application\obj\Release\IED Application.exe

     文件      32620  2010-11-27 19:02  C#并口操作\IED Application\IED Application\obj\Release\IED_Application.IED.resources

     文件        180  2010-11-27 13:22  C#并口操作\IED Application\IED Application\obj\Release\IED_Application.Properties.Resources.resources

     文件        494  2010-11-25 21:11  C#并口操作\IED Application\IED Application\Program.cs

     文件       1380  2010-11-25 21:10  C#并口操作\IED Application\IED Application\Properties\AssemblyInfo.cs

     文件      27648  2010-02-18 01:11  C#并口操作\IED Application\IED Application\Properties\inpout32.dll

     文件       2880  2010-11-25 21:10  C#并口操作\IED Application\IED Application\Properties\Resources.Designer.cs

     文件       5612  2010-11-25 21:10  C#并口操作\IED Application\IED Application\Properties\Resources.resx

............此处省略28个文件信息

评论

共有 条评论