×

VB6复制文件的区别

hqy hqy 发表于2025-02-21 16:13:19 浏览8 评论0

抢沙发发表评论

'先声明复制函数 2Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long

方法一:带属性

1s = App.Path '当前目录 2 rst = CopyFile(s & "\1.txt",  "D:\1.txt", 0)  3If rst = 0 Then 4    MsgBox "替换不成功!" 5Else 6    MsgBox "替换成功!" 7End If

方法二:不带属性

1s = App.Path '当前目录 2FileCopy s & "\1.txt",  "D:\1.txt"


打赏

本文链接:https://www.kinber.cn/post/4930.html 转载需授权!

分享到:


推荐本站淘宝优惠价购买喜欢的宝贝:

image.png

 您阅读本篇文章共花了: 

群贤毕至

访客