Background: Use C # to manipulate the mouse for repetitive work
Background:using Csharp to handle the keyboard or mouse to doing the repetitive work.
Problem: The property "DllImport" is not valid in this claim type. It is only valid in the "method" declaration. Error 1 Property "DllImport" in the Declaration class
Question:attribution "DllImport" is invalid in the declaration, it's just valid in the "method" declaration
Solution: Use an externally invoked method
Solution:use the External method
code example:
private static extern int Mouse_event (
int dwflags,//One of the flags in the following table or a combination of them
int DX,
int dy,//specify absolute position or relative position in X, y direction
int cbuttons,//not used
int dwextrainfo//not used
);
extern is used to declare the method implemented externally, it's often used in the situation of that interop (using System. Runtime.interopservices) to call unmanaged code in and DllImport are used at the same time. At that time the method should declard as static.
Problems with C # in referencing plugins | Csharp cite the plugin problem