Want to switch CDROM in C #, you can use the following code, this is a console program. Using system.text; using system.Runtime.InteropServices;
Class closecd {
[DllImport ( "winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)] protected static extern int mciSendString (string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, IntPtr hwndCallback);
Public static void main () {
int RET = McIndstring ("Set CDAUDIO DOOR OPEN", NULL, 0, INTPTR.ZERO;
Console.readline (); RET = McISendstring ("Set CDAUDIO DOR CLOSED", NULL, 0, INTPTR.ZERO);}}