fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using System.Management;
  11. using System.Management.Instrumentation;
  12.  
  13. namespace WindowsFormsApplication1
  14. {
  15. public partial class Form1 : Form
  16. {
  17. public Form1()
  18. {
  19. InitializeComponent();
  20. }
  21. //GUIの準備
  22. MenuStrip menuStrip;
  23. TextBox textBox1;
  24. ToolStripButton toolStripButton1;
  25. private void Form1_Load(object sender, EventArgs e)
  26. {
  27. textBox1 = new TextBox();
  28. textBox1.Multiline = true;
  29. textBox1.ScrollBars = ScrollBars.Both;
  30. textBox1.Dock = DockStyle.Fill;
  31. this.Controls.Add(textBox1);
  32.  
  33. menuStrip = new MenuStrip();
  34. this.Controls.Add(menuStrip);
  35.  
  36. toolStripButton1 = new ToolStripButton();
  37. toolStripButton1.Text = "実行";
  38. toolStripButton1.Click += new EventHandler(toolStripButton1_Click);
  39. menuStrip.Items.Add(toolStripButton1);
  40. }
  41. //デバイスの取得
  42. void toolStripButton1_Click(object sender, EventArgs e)
  43. {
  44. toolStripButton1.Enabled = false;
  45. textBox1.Clear();
  46. ManagementObjectSearcher mos = new ManagementObjectSearcher(
  47. "SELECT * FROM Win32_PnPEntity");
  48. foreach (ManagementObject mo in mos.Get())
  49. {
  50. //慶安 USBチューナー : ISDB-T DTV Tuner FSUSB2N
  51. string name = mo["Name"].ToString();
  52. if(name.IndexOf("ISDB") >= 0)
  53. textBox1.AppendText(name + Environment.NewLine);
  54. }
  55. toolStripButton1.Enabled = true;
  56. }
  57. }
  58. }
  59.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty