VB6 文件复制与替换

前端之家收集整理的这篇文章主要介绍了VB6 文件复制与替换前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


'先声明函数

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)


If rst = 0 Then MsgBox "替换不成功!" Else MsgBox "替换成功!" End If

猜你在找的VB相关文章