2012-09-20 23 views

回答

4

我知道這樣做的唯一方法是獲取計算機上的WMI Win32_CDROM驅動器實例,然後在Name或DeviceId屬性中檢查DVD。

您甚至可能需要從isntance獲取DeviceID,然後在HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Enum [DeviceIdHere] \ Device Parameters下檢查註冊表,然後檢查是否存在名爲「 DefaultDvdRegion」。這對於CDROM驅動器不存在,但是對於DVD驅動器。

+0

哇它可以幫助我:) – ughani

0

如果您想使用Windows提供的IMAPI,那麼你也可以使用類似代碼:

// Depending on how you import the COM interface, the names of types and methods 
// may differ slightly from the following example. You can either add a reference 
// to the COM library in Visual Studio, or roll your own if you choose. 

MsftDiscRecorder2 recorder = new MsftDiscRecorder2(); 
recorder.InitializeDiscRecorder(uniqueId); // From MsftDiscMaster2 
foreach (FeaturePageType feature in recorder.SupportedFeaturePages) 
{ 
    if (feature == FeaturePageType.DvdRead) 
    { 
     return true; 
    } 
} 
return false; 
相關問題