Share via


Windows Media Player 11 SDK IWMPCdromCollection.count (VB and C#) 

Windows Media Player SDK banner art

Previous Next

IWMPCdromCollection.count (VB and C#)

The count property gets the number of available CD and DVD drives on the system.

  

Property Value

A System.Int32 that is the count of available drives.

Remarks

To retrieve the value of this property, read access to the library is required. For more information, see Library Access.

DVD drives are counted exactly like CD drives. However, the Windows Media Player ActiveX control only supports DVD functionality for Windows XP or later. Typically, DVD drives can play CD media, but CD drives cannot play DVD media.

Example Code

The following example uses count to display the number of available CD and DVD drives in a message box. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.

  
' Store the number of available drives.
Dim numDrives As Integer = player.cdromCollection.count

' Display the number of drives as a string.
System.Windows.Forms.MessageBox.Show("Number of available CD and DVD drives:  " + numDrives.ToString())

FakePre-74ef73c74a2c4378a917dfc50d69c641-c1e46d9f7b884418b41425269fe51af3

// Store the number of available drives.
int numDrives = player.cdromCollection.count;

// Display the number of drives as a string.
System.Windows.Forms.MessageBox.Show("Number of available CD and DVD drives:  " + numDrives.ToString());

Requirements

Version: Windows Media Player 9 Series or later

Namespace: WMPLib

Assembly: Interop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next