您查询的关键词是:vb   浏览器 源码 
下面是原始网址 https://www.haolizi.net/example/view_15862.html 在 2021-06-10 11:49:51 的快照。

360搜索与该网页作者无关,不对其内容负责。

vb 文件浏览器 示例源码(资源管理器) - 开发实例、源码下载 - 好例子网
在好例子网,分享、交流、成长!
您当前所在位置:首页ASP 开发实例VB编程vb 文件浏览器 示例源码(资源管理器)

vb 文件浏览器 示例源码(资源管理器)

VB编程

下载此实例
  • 开发语言:ASP
  • 实例大小:6.36KB
  • 下载次数:17
  • 浏览次数:999
  • 发布时间:2018-06-26
  • 实例类别:VB编程
  • 发 布 人:yishuiyiran
  • 文件格式:.zip
  • 所需积分:2
 相关标签: 文本浏览器

实例介绍

【实例简介】建立一个文本浏览器。窗体上放置驱动器列表框、目录列表框、文件列表框和复选框控件

【实例截图】 

from clipboard

【核心代码】

VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4095
ClientLeft = 120
ClientTop = 450
ClientWidth = 10845
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 10845
StartUpPosition = 3 '窗口缺省
Begin VB.CheckBox Check1
Caption = "只读"
Height = 375
Index = 1
Left = 8280
TabIndex = 11
Top = 960
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "常规"
Height = 375
Index = 0
Left = 6360
TabIndex = 10
Top = 960
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "隐藏"
Height = 375
Index = 5
Left = 8280
TabIndex = 9
Top = 2400
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "存档"
Height = 375
Index = 4
Left = 6360
TabIndex = 8
Top = 2400
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "系统"
Height = 375
Index = 3
Left = 8280
TabIndex = 7
Top = 1680
Width = 1095
End
Begin VB.CheckBox Check1
Caption = "文件夹"
Height = 375
Index = 2
Left = 6360
TabIndex = 6
Top = 1680
Width = 1095
End
Begin VB.DirListBox Dir1
Height = 1770
Left = 600
TabIndex = 2
Top = 1200
Width = 2415
End
Begin VB.DriveListBox Drive1
Height = 300
Left = 600
TabIndex = 1
Top = 720
Width = 1935
End
Begin VB.FileListBox File1
Height = 2250
Left = 3480
TabIndex = 0
Top = 720
Width = 2295
End
Begin VB.Label Label3
Caption = "文件属性"
Height = 255
Left = 7440
TabIndex = 5
Top = 240
Width = 975
End
Begin VB.Label Label2
Caption = "选择文件"
Height = 255
Left = 4080
TabIndex = 4
Top = 240
Width = 1095
End
Begin VB.Label Label1
Caption = "选择驱动器"
Height = 255
Left = 720
TabIndex = 3
Top = 240
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
ChDir Dir1.Path '改变当前目录
File1.Path = Dir1.Path '改变目录列表框的路径
ShowAttr Dir1.Path '设置属性复选框组
End Sub
Private Sub Drive1_Change()
ChDrive Drive1.Drive '改变当前驱动器
Dir1.Path = Drive1.Drive '改变文件列表框的路径
Call ClearAttr '设置属性复选框组
End Sub
Private Sub File1_Click()
ShowAttr File1.FileName '设置属性复选框组
End Sub
Private Sub Form_Load()
Drive1.Drive = "d:\"
File1.Pattern = "*.*"
End Sub
Private Sub ClearAttr()
Dim I As Integer
For I = 0 To 5
'将Check1(0)~Check1(5)复选框清空
Check1(I).Value = 0
Next I
End Sub
Private Sub ShowAttr(ByVal sPath As String)
Dim iAttr As Integer '存储文件的属性值
Call ClearAttr '调用复选框清空子程序
iAttr = GetAttr(sPath) '获取文件的属性
If iAttr And vbNormal Then '判断是否为普通文件
Check1(0).Value = Checked '是则普通复选框选中
End If
If iAttr And vbReadOnly Then '判断是否为只读文件
Check1(1).Value = Checked '是则只读复选框选中
End If
If iAttr And vbDirectory Then '判断是否为目录
Check1(2).Value = Checked '是则文件夹复选框选中
End If
If iAttr And vbSystem Then '判断是否为系统文件
Check1(3).Value = Checked '是则系统复选框选中
End If
If iAttr And vbArchive Then '判断是否为存档文件
Check1(4).Value = Checked '是则存档复选框选中
End If
If iAttr And vbHidden Then '判断是否为隐藏文件
Check1(5).Value = Checked '是则隐藏复选框选中
End If
End Sub

标签: 文本浏览器

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
;
报警