您的位置:首页 > 编程语言 > C#

c#打开关闭CD/DVD光驱代码

2013-02-05 11:03 225 查看
来自:http://outofmemory.cn/code-snippet/470/c-open-close-CD-DVD-guangqu-code

using System.Runtime.InteropServices;
using System.Text;
...
public static void Main( )
{
int result = mciSendString
("set cdaudio door open", null, 0, IntPtr.Zero);
result =
mciSendString ("set cdaudio door closed",
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);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: