как открыть дисковод[C#]

Discussion in 'С/С++, C#, Rust, Swift, Go, Java, Perl, Ruby' started by j-prof, 25 Dec 2010.

  1. j-prof

    j-prof Banned

    Joined:
    29 Aug 2010
    Messages:
    321
    Likes Received:
    11
    Reputations:
    -4
    появилась навязчивая идея открыть дисковод на шарпе
    какие у кого есть варианты :D

    ЗЫ щито я сегодня неодекватен ваще :D :p :D
     
  2. DCrypt

    DCrypt Banned

    Joined:
    21 Jan 2010
    Messages:
    393
    Likes Received:
    35
    Reputations:
    1
    Code:
    [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)]
            protected static extern int mciSendString
               (string mciCommand,
               StringBuilder returnValue,
               int returnLength,
               IntPtr callback);
     
    static void Main(string[] args)
            {
    int result = mciSendString("set cdaudio door open", null, 0, IntPtr.Zero);
                Thread.Sleep(1000);
                result = mciSendString("set cdaudio door closed", null, 0, IntPtr.Zero);
                }
     
  3. .ATK

    .ATK Active Member

    Joined:
    20 Feb 2009
    Messages:
    159
    Likes Received:
    112
    Reputations:
    9
    http://webcache.googleusercontent.com/search?q=cache:http://www.geekpedia.com/tutorial174_Opening-and-closing-the-CD-tray-in-.NET.html
     
  4. j-prof

    j-prof Banned

    Joined:
    29 Aug 2010
    Messages:
    321
    Likes Received:
    11
    Reputations:
    -4
    о респекты ща затесчу а можн еще статью по винапи и шарпу;)
     
Loading...