所以我要簡單的應用程序,只需要幾行:C#的DirectX輸入問題
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。
有人能告訴我問題在哪裏嗎?
謝謝它的作品! :) – TreantBG
歡迎:) –