using System;
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 = mciSendString( "set cdaudio door open", null, 0, IntPtr.Zero ); Console.ReadLine();
ret = mciSendString( "set cdaudio door closed", null, 0, IntPtr.Zero );
}
}
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 = mciSendString( "set cdaudio door open", null, 0, IntPtr.Zero ); Console.ReadLine();
ret = mciSendString( "set cdaudio door closed", null, 0, IntPtr.Zero );
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货