Şekil 1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Management;
namespace cd_serino_ogrenme
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SelectQuery query = new SelectQuery("select * from win32_logicaldisk where drivetype=5");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject mobject in searcher.Get())
{
if ((mobject["volumeserialnumber"] != null))
{
MessageBox.Show("CD ismi: " + mobject["volumename"] + Environment.NewLine + "Seri No: " + mobject["volumeserialnumber"]);
}
else
{
MessageBox.Show("Lütfen Cd Takınız");
}
}
}
}
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Management;
namespace cd_serino_ogrenme
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SelectQuery query = new SelectQuery("select * from win32_logicaldisk where drivetype=5");
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
foreach (ManagementObject mobject in searcher.Get())
{
if ((mobject["volumeserialnumber"] != null))
{
MessageBox.Show("CD ismi: " + mobject["volumename"] + Environment.NewLine + "Seri No: " + mobject["volumeserialnumber"]);
}
else
{
MessageBox.Show("Lütfen Cd Takınız");
}
}
}
}
}
//Bir sonraki makalede görüşmek üzere. Bahadır ŞAHİN
0 comments:
Yorum Gönder