基本信息
源码名称:vb 文件浏览器 示例源码(资源管理器)
源码大小:6.36KB
文件格式:.zip
开发语言:ASP
更新时间:2018-06-26
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 2 元 
   源码介绍
建立一个文本浏览器。窗体上放置驱动器列表框、目录列表框、文件列表框和复选框控件

 

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