Feedback

CD-Try öffnen / schliessen

Sprache: C#

Ein Code um das CD Laufwerk zu Öffnen und zu Schliessen.
using System.Runtime.InteropServices;
using System.Text;
...
public static void Main( )
{
   int result = mciSendString 
      ("Öffnen", null, 0, IntPtr.Zero);
   result = 
      mciSendString ("Schliessen", 
      null, 0, IntPtr.Zero);
}
			
[DllImport("winmm.dll", EntryPoint="mciSendStringA", CharSet=CharSet.Ansi)]
protected static extern int mciSendString
   (string mciCommand,
   StringBuilder returnValue,
   int returnLength,
   IntPtr callback);
using System.Runtime.InteropServices;
using System.Text;
...
public static void Main( )
{
   int result = mciSendString 
      ("Öffnen", null, 0, IntPtr.Zero);
   result = 
      mciSendString ("Schliessen", 
      null, 0, IntPtr.Zero);
}
			
[DllImport("winmm.dll", EntryPoint="mciSendStringA", CharSet=CharSet.Ansi)]
protected static extern int mciSendString
   (string mciCommand,
   StringBuilder returnValue,
   int returnLength,
   IntPtr callback);