|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using CdRom;
namespace cd_rom_test
{
public partial class form1 : Form
{
CDRom cd_rom;
public form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
cd_rom = new CDRom();
RefresH();
}
private void button1_Click(object sender, EventArgs e)
{
RefresH();
}
void RefresH()
{
listBox1.Items.Clear();
listBox1.Items.Add("Cd-Rom Names : ");
//all cd-roms in an string array
foreach(string temp in cd_rom.CDRomName)
listBox1.Items.Add(temp);
listBox1.Items.Add("---------------------------------------------------------");
//all drive name
listBox1.Items.Add("drives : ");
foreach (string temp in cd_rom.DriveName)
listBox1.Items.Add(temp);
listBox1.Items.Add("----------------------------------------------------------");
//has inserted cd into drive ? false or true
listBox1.Items.Add("has inserted cd into drive ? ----> " + cd_rom.CdinCDRom.ToString());
listBox1.Items.Add("-----------------------------------------------------------");
//if cd is aviliable what's cd name :
listBox1.Items.Add("name of cd inserted (label of cd): " + cd_rom.CdName);
listBox1.Items.Add("------------------------------------------------------------");
// drive of cd-rom
listBox1.Items.Add("CD Drive : " + cd_rom.CdDriveName)
;
}
private void button2_Click(object sender, EventArgs e)
{
cd_rom.CdRomOpening();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I'm engineer in Computer SCIENCE,i'm Work on indexing & software protection,and working in Abtin Co,