私はc#を初めて使用し、タイトルで説明した方法に問題があります。コードが少し長いので、pastebinに投稿しました。32feet.net APIを使用して、Bluetoothデバイスをリストにリストしています。
問題は43行目と50行目にあり、次のステートメントがあります。
エラー1タイプ「WindowsFormsApplication1.Form1」は、同じパラメータータイプC:\ Users \ andre \ document \ visual studio 2010 \ Projects \ blueetoth \ blueetoth \ Form1.cs 4333blueetothで「Dispose」というメンバーを既に定義しています。
と
*エラー2タイプ「WindowsFormsApplication1.Form1」は、同じパラメータータイプC:\ Users \ andre \ document \ visual studio 2010 \ Projects \ blueetoth \ blueetoth \ Form1.cs 50 22blueetoth*で「InitializeComponent」というメンバーを既に定義しています。
Pastebin: http: //pastebin.com/LFEvaz2X
短いバージョン:dispose()
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
短いバージョン:initializeComponent
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.listBox1 = new System.Windows.Forms.ListBox();
//
// listBox1
//
this.listBox1.Location = new System.Drawing.Point(14, 14);
this.listBox1.Size = new System.Drawing.Size(212, 212);
//
// Form1
//
this.ClientSize = new System.Drawing.Size(240, 268);
this.Controls.Add(this.listBox1);
this.Menu = this.mainMenu1;
this.MinimizeBox = false;
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
}