第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在C#中如何判彈出所有光驅(qū)?

在C#中如何判彈出所有光驅(qū)?

溫溫醬 2018-12-25 14:04:20
我機器上有兩光驅(qū),下面這段代碼只能彈出第一個光驅(qū),無法指定彈出第二個光驅(qū)。應該怎么寫才可能呢?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   );    }}
查看完整描述

2 回答

?
夢里花落0921

TA貢獻1772條經(jīng)驗 獲得超6個贊

我也很好奇,google一下,答案如下: //M:是光驅(qū)所在的盤符 mciSendString('open M: type CDAudio alias finch wait', nil, 0, Self.Handle); //打開光驅(qū) mciSendString('set finch door open wait', nil, 0, Self.Handle); //關閉光驅(qū) // mciSendString('set finch door closed wait', nil, 0, Self.Handle); mciSendString('Close finch', nil, 0, Self.Handle);

查看完整回答
反對 回復 2018-12-29
  • 2 回答
  • 0 關注
  • 642 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號