Visual Basic - Como obtener la torre de Cd de cualquier maquina

Life is soft - evento anual de software empresarial
 
Vista:

Como obtener la torre de Cd de cualquier maquina

Publicado por Pavel Gonzalez (2 intervenciones) el 17/12/2001 11:59:16
Hola amigos

Estoy haciendo una aplicacion en Visual Basic 5 y no tengo mucha experiencia en este.
Necesito saber como obtener la Torre "D,E,F" de la unidad de CD de cualquier maquina ya que mi programa al cargarse tiene que leer de esta.

Existira alguna funcion en VB que me la devuelva.????

Por favor si alguien sabe como hacer esto, ayudeme.
Atentamente Pavel

Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Como obtener la torre de Cd de cualquier maquin

Publicado por Athlon (76 intervenciones) el 17/12/2001 16:06:19
Pon un textbox (miltiline) y un command button y agrega este codigo:

Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Private Sub Command1_Click()
Text1.Text = FindCDROM
End Sub
Function FindCDROM() As String
Dim Drive As Integer
Const DRIVE_CDROM = 5
FindCDROM = "No hay CD_ROM Instalado"

For Drive = 65 To 90
If GetDriveType(Chr(Drive) & ":\") = DRIVE_CDROM Then
FindCDROM = "CD-ROM Drive " & Chr(Drive) & ":\"
Exit For
End If
Next Drive
End Function

Espero te sirva. Saludos.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar