C# 在引用插件中 出现的问题| Csharp cite the plugin problem

王朝学院·作者佚名  2016-05-20
窄屏简体版  字體: 小  |  中  |  大  |  超大  

C# 在引用插件中 出现的问题| Csharp cite the plugin PRoblem背景:使用C#操纵鼠标进行重复性的工作

background: using Csharp to handle the keyboard or mouse to do the repetitive work.

问题:属性“DllImport”在该声明类型中无效。它只在“method”声明中有效。错误 1 属性“DllImport”在该声明类

Question:attribution “DllImport” is invalid in the declaration, it is just valid in the “method” declaration

解决方案:使用外部调用的方法

Solution:Use the external method

code example:

private static extern int mouse_event( int dwFlags,// 下表中标志之一或它们的组合 int dx, int dy, //指定x,y方向的绝对位置或相对位置 int cButtons,//没有使用 int dwExtraInfo//没有使用 ); extern is used to declare the method implemented externally, it is often used in the situation that interop (using System.Runtime.InteropServices) to call unmanaged code in and DllImport is used at the same time. At that time the method should declard as static.

 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
© 2005- 王朝網路 版權所有 導航