Thursday 18 August 2011

How insert\eject cd drive?


It is very easy to insert or eject cod with the help of coding.

What you have to do is to import a .dll in your code and with the help of

1 class you can easily do this work....

You can download that .dll from the link given underneath:

(don’t worry about its size, it is only 5kb  long)

CD.dll

The dll name is CD

How to use this dll is explained underneath:


add CD namespace in your code

using cd



make an object of InsertEject class


InsertEject obj = new InsertEject();

this obj has 2 functions eject and insert
use as you want to use


I am a C# user that's why I will write code in C# language but you will be able to transform

This code into your language because dlls are supported by all .Net Languages









help code is given in c# laguage:

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 CD;

namespace WindowsFormsApplication1

{

public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

}



InsertEject ie = new InsertEject();

private void Form1_Load(object sender, EventArgs e)

{



/// for ejection call

/// parameters takes drives name as char

ej('g');



/// for insertion call

/// parameters takes drives name as char

i('g');
}

public void ej(char c)

{

/// for eject

ie.insert(c);

}

public void i(char c)

{

/// for eject

ie.insert(c);

}

}

}








God Bless You,
Jai SiyaRam