c#对并口的读写操作!INPOUT32.DLLusingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Linq;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Runtime.InteropServices;namespaceIED_Application{publicpartialclassIED:Form{//intled=0x278;[DllImport("inpout32.dll",EntryPoint="Out32")]publicstaticexternvoidOutput(intadress,intvalue);[DllImport("user32.dll",EntryPoint="MessageBoxA")]publicstaticexternvoidMsgBox(inthWnd,stringmsg,stringcaption,inttype);publicIED(){InitializeComponent();}privatevoidIED_Load(objectsender,EventArgse){}privatevoidoutput_Click(objectsender,EventArgse){MsgBox(0,"这里是用DllImport","tiaozhanbei",0x30);IED.Output(888,253);}}}
2024/7/19 7:04:44
499KB
c#
并口
1