Мне нужно лучшее решение для работы с неподготовленными дисками, и я хочу иметь возможность просматривать и изменять файлы на моем rw-диске. К сожалению, это всегда выдает ошибку неготовности диска, и единственное, что я могу сделать, это обработать ошибку.
Пока я сделал это:
Мой диск:
Private Sub imperialdrive_Change()
On Error GoTo I_have_a_baad_feeling_about_this
imperialdir.Path = RootPathOnDrive(imperialdrive.Drive)
Exit Sub
I_have_a_baad_feeling_about_this:
If Err.Number = 68 Then
MsgBox "The selected drive is not available at the moment.", vbOKOnly, "I feel a disturbance in the force."
Else
MsgBox Err.Number & " " & Err.Description, vbCritical, "There is a Bounty Hunter here."
End If
End Sub
Моя функция:
'Such a bad choise for a function name
'It sounds like doing smt more than changing the name of drive lol
Public Function RootPathOnDrive(ByVal Drive)
'So how it comes as "k:" instead of "k:\" Is it really cause its not ready? Both ways i should try reaching "k:\"
RootPathOnDrive = Left(Drive, 1) & ":\"
End Function