VB工程--百例49--显示文件路径
2012-02-01 19:53
218 查看
Option Explicit
Private Sub Dir1_Change()
File1.Path = Dir1.Path
Label1.Caption = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
Label1.Caption = Drive1.Drive
End Sub
Private Sub File1_Click()
If Right(Dir1.Path, 1) = "\" Then 红字是right语法 ;若目录路径最右侧的字符为"\"
Label1.Caption = Dir1.Path & File1.FileName 显示所选择的文件名
Else 若目录路径最右侧的字符不是为"\"
Label1.Caption = Dir1.Path & "\" & File1.FileName 在显示的文件名前添加"\"
End If
End Sub
Private Sub Form_Load()
Dir1.Path = Drive1.Drive 文件所在的驱动器与目录项符合
File1.FileName = Dir1.Path 文件的路径是目录列表中的路径
End Sub
成品图
此题和VB百例48相类似
Private Sub Dir1_Change()
File1.Path = Dir1.Path
Label1.Caption = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
Label1.Caption = Drive1.Drive
End Sub
Private Sub File1_Click()
If Right(Dir1.Path, 1) = "\" Then 红字是right语法 ;若目录路径最右侧的字符为"\"
Label1.Caption = Dir1.Path & File1.FileName 显示所选择的文件名
Else 若目录路径最右侧的字符不是为"\"
Label1.Caption = Dir1.Path & "\" & File1.FileName 在显示的文件名前添加"\"
End If
End Sub
Private Sub Form_Load()
Dir1.Path = Drive1.Drive 文件所在的驱动器与目录项符合
File1.FileName = Dir1.Path 文件的路径是目录列表中的路径
End Sub
成品图
此题和VB百例48相类似
相关文章推荐
- VB工程--百例48--文件过滤
- Source Insight查看ARM汇编 && 高亮显示文本 && 标题栏显示全路径 && 从工程批量去除文件 && 添加无扩展名文件 && 快捷键插入时间日期 && 查看PHP源码
- VB工程--百例87--删除文件
- VB工程--百例53--文件改名
- 显示delphi工程文件路径的 delphi IDE 扩展
- Source Insight查看ARM汇编源 && 打开project窗口出错 && 高亮显示程序 && 标题栏显示全路径 && 从工程批量去除文件 && 添加无扩展名文件 && 快捷键插入时间日期
- source insight3.5的使用技巧1——sourceinsight下工程文件位置如何显示为相对路径
- VB工程--百例84--播放视频AVI文件.
- 将盘mount到已存在路径,路径下文件显示不了
- Mac下快捷显示finder中文件路径
- 通过ap服务器来找到工程文件的绝对路径
- SourceInsight工程文件与源文件相对路径
- VB工程18--百例34--喷泉
- 拖拽文件显示文件路径
- javaweb工程,Servlet里面获取当前WEB跟路径的文件绝对路径地址
- eclipse 查看工程或者文件的磁盘路径
- TreeView 显示指定路径下的所有文件和文件夹
- eclipse中java工程打包成jar无法找到src资源文件路径的解决办法
- 让Win8文件资源管理器显示全路径的设置方法
- VB工程--百例59--指数、对数函数计算器