文件被打开时当然可以用FileCopy的,否则的话系统是怎么拷贝的,而且我在VC中拷过没有问题。

解决方案 »

  1.   

    vb 当文件打开时,不能filecopy.
      

  2.   

       先关闭再 copy 再打开,行不?
      

  3.   

    自己写FileCopyA函数:Public Sub FileCopyA(Des As String, Sou As String)
        Dim lc As Long
        lc = FileLen(Sou)    Dim l As Long
        l = FreeFile()    Open Sou For Binary Shared As #l    On Error Goto ErrorHandle    Dim lfs As Long
        lfs = l    l = FreeFile()
        Open Des For Binary As #l
        
        Dim lfd As Long
        lfd = l    Dim bt() As Byte
        Redim bt(lc-1)
        
        Get #lfs,,bt
        Close #lfs
        lfs = 0    Put #lfd,,bt
        Close #lfd    exit sub
    ErrorHandle:
    ...
    End Sub'当然如果文件比较大那得一段一段拷才行。