【发布时间】:2011-07-06 20:58:11
【问题描述】:
所以我有一个简单的应用程序,只有几行:
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 Microsoft.DirectX.DirectInput;
namespace asdasd
{
public partial class Form1 : Form
{
public Device joystick;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
foreach (
DeviceInstance di in
Manager.GetDevices(
DeviceClass.GameControl,
EnumDevicesFlags.AttachedOnly))
{
joystick = new Device(di.InstanceGuid);
break;
}
if (joystick == null)
{
throw new Exception("No joystick found.");
}
}
}
}
我尝试在我的计算机上获取活动操纵杆,但出现错误:
我安装了 Microsoft.DirectX.DirectInput 程序集,并安装了 directX SDK 2010。
谁能告诉我问题出在哪里?
【问题讨论】: