//類名:EcanDOS
//作用:DOS常用命令操作
//作者:劉典武
//時間:2010-12-01
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Runtime.InteropServices;
namespace Ecan
{
public class EcanDOS
{
//引入API函數
[DllImportAttribute("user32.dll")]
private static extern int FindWindow(string ClassName, string WindowName);
[DllImport("user32.dll")]
private static extern int ShowWindow(int handle, int cmdShow);
[DllImport("winmm.dll", EntryPoint = "mciSendString", CharSet = CharSet.Auto)]
private static extern int mciSendString(string lpstrCommand, string lpstrReturnstring, int uReturnLength, int hwndCallback);
private const int SW_HIDE = 0;//API參數表示隱藏窗口
private const int SW_SHOW = 5;//API參數表示用當前的大小和位置顯示窗口
public void 彈出光驅()
{
mciSendString("set CDAudio door open", null, 127, 0);
}
public void 關閉光驅()
{
mciSendString("set CDAudio door closed", null, 127, 0);
}
public