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


你可能感兴趣的:(C#控制光驱开关)