'先声明函数
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String,ByVal lpNewFileName As String,ByVal bFailIfExists As Long) As Long
'D:\1.txt复制到C:\2.txt-----0表示文件存在时就覆盖
rst = CopyFile("D:\1.txt","C:\2.txt",0)
原文链接:https://www.f2er.com/vb/257323.html