Private Function blnCheckFDProtected() As Boolean
On Error GoTo ErrWrite
strFloppyDrv = "A:\"
strWriteTest = strFloppyDrv & "WriteTest"
intFileNum = FreeFile
Open strWriteTest For Binary Access Write As #intFileNum
Close
Kill strWriteTest
blnCheckFDProtected = True
Exit Function
ErrWrite:
If Err.Number > 0 Then
Select Case Err.Number
Case 70
'protected mode
blnCheckFDProtected = False
MsgBox "protected mode"
Case Else
MsgBox Err.Description
blnCheckFDProtected = False
End Select
End If
End Function试试上边的代码吧
On Error GoTo ErrWrite
strFloppyDrv = "A:\"
strWriteTest = strFloppyDrv & "WriteTest"
intFileNum = FreeFile
Open strWriteTest For Binary Access Write As #intFileNum
Close
Kill strWriteTest
blnCheckFDProtected = True
Exit Function
ErrWrite:
If Err.Number > 0 Then
Select Case Err.Number
Case 70
'protected mode
blnCheckFDProtected = False
MsgBox "protected mode"
Case Else
MsgBox Err.Description
blnCheckFDProtected = False
End Select
End If
End Function试试上边的代码吧
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货