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