如何打开和关闭光驱

raulredondo 2003-10-18 04:24:42
同上
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
rgbcn 2003-10-18
  • 打赏
  • 举报
回复
see

http://expert.csdn.net/Expert/topic/2177/2177992.xml?temp=1.140773E-03
rgbcn 2003-10-18
  • 打赏
  • 举报
回复
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 );
}
}
kuangren 2003-10-18
  • 打赏
  • 举报
回复
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 );
}
}

110,499

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧