VB将当前文件夹中文件复制到指定位置
3个回答
2013-12-06
展开全部
先在“工程”菜单里选择“引用”,复选“Microsoft scripting runtime”-确定(使用FSO文件操作系统)
Private Sub Form_Click()
Dim MyFSO As New FileSystemObject
Dim MyFile As File
Set MyFile = MyFSO.GetFile("文件路径名称")
MyFile.copy "D:\"
End Sub
Private Sub Form_Click()
Dim MyFSO As New FileSystemObject
Dim MyFile As File
Set MyFile = MyFSO.GetFile("文件路径名称")
MyFile.copy "D:\"
End Sub
2013-12-06
展开全部
Private Sub Command1_Click()
FileCopy "c:\1.txt", "z:\1.txt"
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If Time = #12:00:00 PM# Then kill "z:\1.txt"
End Sub
FileCopy "c:\1.txt", "z:\1.txt"
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If Time = #12:00:00 PM# Then kill "z:\1.txt"
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-12-06
展开全部
FileCopy "目标文件","复制到什么地方" 文件的扩展名不能忘记写
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询