下面代码那里错了???

来源:百度知道 编辑:UC知道 时间:2024/05/15 07:03:20
Private Sub Combo1_Click()
File1.Pattern = Combo1.Text

End Sub

Private Sub Command1_Click()
Dim sourfile As String
Dim destfile As String
str2$ = "请输入要复制的目的文件名:"
sourfile = choicefile
destfile = InputBox$(str2$, "复制文件")
If destfile <> " " Then
FileCopy sourfile, destfile
End If
End Sub

Private Sub Command2_Click()
Dim oldfile As String
Dim newfile As String
Title$ = "重命名"
str0$ = "请再输入一遍需要修改的文件名(全路径)"
str1$ = choicefile + Chr$(10) + Chr$(13) + str0$
str2$ = "请输入新文件名"
oldname = InputBox$(str1$, Title$)
msg$ = "确认被更改的文件名" & oldname
p = MsgBox(msg$, 35, "数据检查框")
If p = 6 Then
newname = InputBox(str2$, titel$)

Name oldname As newname
MsgBox "你的新文件名是:" + newname
End If

End Sub

Private Sub Command3_Click()
Dim kill

这是个文件管理程序吧~

choicefile没有被传值,声明一个公有变量choicefile吧~
还有,我觉得最好在file1没有被点过之前,三个功能按钮的enabled应该处于false状态,这样比较安全.

PS:我没有看太仔细,你的程序里有choicedfile和choicefile两个变量,是失误写错了还是确实就是两个变量哩?