using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
[DllImport("user32", EntryPoint = "GetAsyncKeyState", CharSet = CharSet.Ansi, SetLastError = true)]
public static int KeyPress2(int key);
(这些是影响它的唯一比特。
答案 0 :(得分:3)
您必须添加“外部”修饰符: 该方法是外部DLL的一部分(非托管,我认为)