C#控制光驱开关

光驱弹出与关闭

 

using System.Runtime.InteropServices ;

 

[DllImport("winmm.dll")]


public static extern int mciSendString(string s1,string s2,int i1,int i2);


private void button1_Click(object sender, System.EventArgs e) {


 mciSendString ("set cdaudio door open","",0,0);


}

private void button2_Click(object sender, System.EventArgs e) {


 mciSendString ("set cdaudio door closed","",0,0);


posted @ 2006-09-08 13:00  greystar  阅读(194)  评论(0编辑  收藏  举报