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 );
   }}C#怎样打开关闭CDROM?
原创
             ©著作权归作者所有:来自51CTO博客作者biyusr216的原创作品,请联系作者获取转载授权,否则将追究法律责任        
             
            
        
                提问和评论都可以,用心的回复会被更多人看到
                评论
            
            
                    发布评论
                
            
            相关文章
        
         
 
                    













 
                    

 
                 
                    