VB复制问题解决

来源:百度知道 编辑:UC知道 时间:2024/06/02 03:55:25
我想做一个程序:
点击Command2 打开浏览(可以是文件夹),将路径放在text1中
点击Command3 打开浏览(可以是文件夹),将路径放在text2中
当Check1=ture时
点击按钮Command1 将text1路径的所指的内容复制到text2指向的路径中,删除text1中所指的文件(或文件夹)
当Check1=false时
点击按钮Command1 将text1路径的所指的内容复制到text2指向的路径中
不删除text1中所指的文件(或文件夹)

水能帮帮我把程序写一下 ,最好有解释!
回答的好,可以帮我把这两个类似的问题也答了
http://zhidao.baidu.com/question/51469952.html
http://zhidao.baidu.com/question/51470199.html
http://zhidao.baidu.com/question/51470296.html

我要的是编程代码

少打一句话,呵呵,抱歉
Private Sub Command1_Click()
Dim k As Boolean
If Check1.Value = 1 Then
Name Text1.Text As Text2.Text
Else
If a(Text1.Text) = True Then
FileCopy Text1.Text, Text2.Text
Else
FileSystemObject.CopyFolder Text1.Text, Text2.Text
End If
End If
End Sub
Function a(PathName) As Boolean
On Error GoTo Err
Open PathName For Input As #1
Close #1
a = True
Exit Function
Err:
Close #1
a = False
End Function