文件管理器设计报告.docVIP

  • 15
  • 0
  • 约5.77千字
  • 约 6页
  • 2018-04-23 发布于河南
  • 举报
文件管理器设计报告

文件管理器设计报告 学院 班级 学号 姓名 成绩 一、设计思路 1.要达到的目的 ①培养学生综合利用语言进行程序设计的能力主要培养学生Private Sub Command1_Click() Dim msg$ On Error GoTo errBad ChDir Form1.Dir1.Path 设置到当前路径 MkDir Text1.Text Form1.Dir1.Refresh 更新目录列表 Unload Form2 卸载窗体 Exit Sub errBad: If (err = 75) Then MsgBox 路径已经存在或设备未准备好或不存在, vbOKOnly Else If (err = 76) Then MsgBox 路径名错误, vbOKOnly Else msg$ = 发现未知错误,错误号= + Str$(err) MsgBox msg$, vbOKOnly End If End If End Sub 删除子过程 Sub Del() Dim myDir$, reTempDir$ On Error GoTo errBad If curFile Then Kill curFile File1.Refresh 文件列表更新 Else If curDirec Then reTempDir = curDirec: myDir$ = curDirec lenfile = Len(reTempDir) 获取上级目录 Do While lenfile 1 If Right$(reTempDir, 1) = \ Then reTempDir = Left$(reTempDir, lenfile - 1) 测试是否到了根目录 If Right$(reTempDir, 1) = : Then reTempDir = reTempDir \ End If Exit Do End If reTempDir = Left$(reTempDir, lenfile - 1) lenfile = Len(reTempDir) Loop If lenfile = 1 Then Exit Sub Dir1.Path = reTempDir ChDir Dir1.Path 返回上级目录 RmDir myDir$ 需在上级目录进行删除操作 Dir1.Refresh 目录列表更新 End If End If Exit Sub errBad: If (err = 53) Then MsgBox 文件不存在, vbOKOnly Else If (err = 75) Then MsgBox 目录中还存在文件, vbOKOnly Else msg$ = 发现错误,错误号= + Str$(err) MsgBox msg$, vbOKOnly End If End If End Sub 查找子过程 Private Sub Command1_Click() Dim lenPath As Integer Dim tempName$, msg$ On Error GoTo errBad If curFile Then 说明点击的是文件列表 If Right$(curName, 1) \ Then

文档评论(0)

1亿VIP精品文档

相关文档