Visual Basic - componente vbx

Life is soft - evento anual de software empresarial
 
Vista:

componente vbx

Publicado por bill_mg (1 intervención) el 11/09/2003 15:48:56
Urgente. como puedo incorporar en un proyecto un control vbx. necesito leer el serial del disco duro
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:componente vbx

Publicado por Rafael (2 intervenciones) el 11/09/2003 17:30:01
Para Obtener informacion de un disco duro:

Declaracion Api:

Private Declare Function GetVolumeInformation _
Lib "kernel32" Alias "GetVolumeInformationA" ( _
ByVal RootPathName As String, _
ByVal VolumeNameBuffer As String, _
ByVal VolumeNameSize As Long, _
ByRef VolumeSerialNumber As Long, _
ByRef MaximumComponentLength As Long, _
ByRef FileSystemFlags As Long, _
ByVal FileSystemNameBuffer As String, _
ByVal FileSystemNameSize As Long _
) As Long

\'----------------------------
Dim VolumeName As String
Dim FileSystemName As String
Dim SerialNumber, Unused As Long

VolumeName = String$(255, 0)
FileSystemName = String$(255, 0)

If GetVolumeInformation(\"C:\\\", VolumeName, Len(VolumeName), _
SerialNumber, Unused, Unused, FileSystemName, _
Len (FileSystemName)) <> 0 Then

Debug.Print \"Volume label: \" & Trim(VolumeName)
Debug.Print \"Serial number: \" & Hex$(SerialNumber)
Debug.Print \"FileSystemName: \" & Trim(FileSystemName)

Else
Debug.Print \"Error: \" & Err.LastDllError
End If
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