Private Sub Command1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Command1.Click
Dim root As String
Dim volume_name As String
Dim serial_number As Integer
Dim max_component_length As Integer
Dim file_system_flags As Integer
Dim file_system_name As String
Dim pos As Integer
root = Text1.Text
volume_name = Space(1024)
file_system_name = Space(1024)
If GetVolumeInformation(root, volume_name, _
Len(volume_name), serial_number, _
max_component_length, file_system_flags, _
file_system_name, Len(file_system_name)) = 0 Then
MessageBox.Show("Error getting volume " & _
"information.", "Error Getting Information", _
MessageBoxButtons.OK, _
MessageBoxIcon.Exclamation)
Exit Sub
End If
pos = volume_name.IndexOf(Chr(0))
volume_name = volume_name.Substring(0, pos)
lblVolumeName.Text = volume_name
lblSerialNumber.Text = serial_number.ToString
lblMaxComponentLength.Text = _
max_component_length.ToString
pos = file_system_name.IndexOf(Chr(0))
file_system_name = file_system_name.Substring(0, pos)
lblFileSystem.Text = file_system_name
lblFlags.Text = "&&H" & Hex$(file_system_flags)
End Sub
|