使用api函数。
详细的情况我记不清了。
等我回家再贴上来。

解决方案 »

  1.   

    哇!白天对着电脑一整天,晚上还上,baoxiang(包香)真英雄也!
      

  2.   

    Option Explicit'    Purpose:
    '    Author:吴文智
    '      Date:2001-11-08
    'Description:要试用本例请在窗体中填加一个按钮
    '            然后在代码窗体中粘贴如下代码
    '            Good luck!
    Private Sub Command1_Click()
        On Error GoTo Errhandle
        
        '这里指定一个根本不可能存在的文件名来引发错误
        Open "a:\~-_._-~" For Input As #1
        Close #1
        
        '如果程序正确地执行到这里,说明你所指定的文件名是存在的.
        '为了防止程序执行到这,尽量用些奇怪的文件名
        Exit Sub
    Errhandle:
        Select Case Err.Number
        Case 57
            'I/O错
        Case 53
            '文件未找到,这时软驱里是有盘的.可以拷贝文件
        Case 71
            '软驱中无盘
        Case Else
            MsgBox Err.Description, vbInformation, Err.Number
        End Select
    End Sub
      

  3.   

    比较简单地判断,可以用下面的函数:
    Function DoesDiskReady(sDrive As String) As Boolean
        
    On Error GoTo handleEror
        
        Dim sFiles As String
        
        sFiles = Dir(sDrive)
        
        DoesDiskReady = True
        Exit Function
        
    handleEror:
        DoesDiskReady = False
        
    End Function调用:
    If DoesDiskReady("a:\")=True Then
       MsgBox "盘片准备好了。"
    Else
       MsgBox "盘片还没有准备好或者已经被破坏。"
    End If
      

  4.   

    稍微修改一下(英语语法问题),呵呵Function IsDiskReady(sDrive As String) As Boolean
        
    On Error GoTo handleEror
        
        Dim sFiles As String
        
        sFiles = Dir(sDrive)
        
        IsDiskReady = True
        Exit Function
        
    handleEror:
        IsDiskReady = False
        
    End Function调用:
    If IsDiskReady("a:\")=True Then
      MsgBox "盘片准备好了。"
    Else
      MsgBox "盘片还没有准备好或者已经被破坏。"
    End If