⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 attrform1.frm

📁 采用vb写的资料系统管理器功能特别
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Height          =   255
         Left            =   2400
         TabIndex        =   20
         Top             =   1200
         Width           =   735
      End
      Begin VB.Label lblTypefldr 
         Caption         =   "lblTypefldr"
         Height          =   255
         Left            =   1080
         TabIndex        =   19
         Top             =   1200
         Width           =   1215
      End
      Begin VB.Label label5 
         Caption         =   "类型:"
         Height          =   255
         Left            =   480
         TabIndex        =   18
         Top             =   1200
         Width           =   735
      End
      Begin VB.Line Line2 
         X1              =   360
         X2              =   2400
         Y1              =   960
         Y2              =   960
      End
      Begin VB.Label lblnamefldr 
         Caption         =   "Label4"
         Height          =   255
         Left            =   1200
         TabIndex        =   17
         Top             =   480
         Width           =   1575
      End
      Begin VB.Image imgfldr 
         Height          =   495
         Left            =   480
         Top             =   360
         Width           =   495
      End
   End
   Begin VB.CommandButton cmbCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   495
      Left            =   3360
      TabIndex        =   2
      Top             =   5280
      Width           =   1215
   End
   Begin VB.CommandButton cmbOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   495
      Left            =   1920
      TabIndex        =   1
      Top             =   5280
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Height          =   4935
      Index           =   0
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Visible         =   0   'False
      Width           =   4455
      Begin VB.TextBox txtVol 
         Height          =   375
         Left            =   1680
         TabIndex        =   6
         Top             =   1080
         Width           =   1815
      End
      Begin VB.Label lblSpace 
         Caption         =   "Label11"
         Height          =   255
         Left            =   1680
         TabIndex        =   16
         Top             =   4200
         Width           =   1935
      End
      Begin VB.Label lblUsed 
         Caption         =   "Label10"
         Height          =   255
         Left            =   1680
         TabIndex        =   15
         Top             =   3720
         Width           =   1935
      End
      Begin VB.Label lblTotal 
         Caption         =   "Label9"
         Height          =   255
         Left            =   1680
         TabIndex        =   14
         Top             =   3120
         Width           =   1815
      End
      Begin VB.Label Label8 
         Caption         =   "可用空间:"
         Height          =   255
         Left            =   480
         TabIndex        =   13
         Top             =   4200
         Width           =   975
      End
      Begin VB.Label Label7 
         Caption         =   "已用空间:"
         Height          =   255
         Left            =   480
         TabIndex        =   12
         Top             =   3720
         Width           =   1095
      End
      Begin VB.Label Label6 
         Caption         =   "总容量:"
         Height          =   255
         Left            =   480
         TabIndex        =   11
         Top             =   3120
         Width           =   735
      End
      Begin VB.Line Line1 
         Index           =   1
         X1              =   240
         X2              =   4080
         Y1              =   2760
         Y2              =   2760
      End
      Begin VB.Label lblFS 
         Caption         =   "1"
         Height          =   255
         Left            =   1680
         TabIndex        =   10
         Top             =   2280
         Width           =   1815
      End
      Begin VB.Label lblTypedrv 
         Caption         =   "1"
         Height          =   255
         Left            =   1680
         TabIndex        =   9
         Top             =   1800
         Width           =   1695
      End
      Begin VB.Label Label3 
         Caption         =   "文件系统:"
         Height          =   255
         Left            =   480
         TabIndex        =   8
         Top             =   2280
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "类型:"
         Height          =   255
         Left            =   480
         TabIndex        =   7
         Top             =   1800
         Width           =   615
      End
      Begin VB.Line Line1 
         Index           =   0
         X1              =   240
         X2              =   1920
         Y1              =   960
         Y2              =   960
      End
      Begin VB.Label Label1 
         Caption         =   "卷标:"
         Height          =   255
         Left            =   480
         TabIndex        =   5
         Top             =   1200
         Width           =   615
      End
      Begin VB.Label lblNamedrv 
         Height          =   255
         Left            =   1200
         TabIndex        =   4
         Top             =   480
         Width           =   1215
      End
      Begin VB.Image imgIcon 
         Height          =   495
         Left            =   480
         Top             =   360
         Width           =   495
      End
   End
End
Attribute VB_Name = "Attrform"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cmbCancel_Click()
    Frame1(g_intWho).Visible = False
    Unload Attrform

End Sub

Private Sub cmbOK_Click()
    Dim attr As Integer
    attr = fldr.Attributes
    Select Case g_intWho
    Case 0
        If drv.VolumeName <> txtVol.Text Then
            drv.VolumeName = txtVol.Text
            frmFile.tvwFile.Nodes(drv.path + "\").Text = drv.DriveLetter + "(" + drv.VolumeName + ")"
        End If
   ' Case 1
        '只读
    '    If (fldr.Attributes And ReadOnly) <> 0 Then
    '        If chkreadfldr.Value = 0 Then
    '            attr = attr - 1
    '            fldr.Attributes = attr
    '        End If
   '     Else
    '        If chkreadfldr.Value = 1 Then
    '            attr = attr + 1
    '            fldr.Attributes = attr
    '        End If
    '    End If
    '    '存档
    '    If (fldr.Attributes And Archive) <> 0 Then
    '        If chkarchivefldr.Value = 0 Then fldr.Attributes = fldr.Attributes - Archive
    '    Else
    '        If chkarchivefldr.Value = 1 Then fldr.Attributes = fldr.Attributes + Archive
    '    End If
    '    '系统
    '    If (fldr.Attributes And System) <> 0 Then
    '        If chksysfldr.Value = 0 Then fldr.Attributes = fldr.Attributes - System
    '    Else
    '        If chksysfldr.Value = 1 Then fldr.Attributes = fldr.Attributes + System
    '    End If
    '    '隐藏
    '    If (fldr.Attributes And Hidden) <> 0 Then
   '         If chkhidefldr.Value = 0 Then fldr.Attributes = fldr.Attributes - Hidden
   '     Else
     '       If chkhidefldr.Value = 1 Then fldr.Attributes = fldr.Attributes + Hidden
      '  End If
    Case 2 '文件
        '只读
        If (fl.Attributes And ReadOnly) <> 0 Then
            If chkreadfl.Value = 0 Then fl.Attributes = fl.Attributes - ReadOnly
        Else
            If chkreadfl.Value = 1 Then fl.Attributes = fl.Attributes + ReadOnly
        End If
        '存档
        If (fl.Attributes And Archive) <> 0 Then
            If chkarchivefl.Value = 0 Then fl.Attributes = fl.Attributes - Archive
        Else
            If chkarchivefl.Value = 1 Then fl.Attributes = fl.Attributes + Archive
        End If
        '系统
        If (fl.Attributes And System) <> 0 Then
            If chksysfl.Value = 0 Then fl.Attributes = fl.Attributes - System
        Else
            If chksysfl.Value = 1 Then fl.Attributes = fl.Attributes + System
        End If
        '隐藏
        If (fl.Attributes And Hidden) <> 0 Then
            If chkhidefl.Value = 0 Then fl.Attributes = fl.Attributes - Hidden
        Else
            If chkhidefl.Value = 1 Then fl.Attributes = fl.Attributes + Hidden
        End If
        
    End Select
    '显示其结果
    
    Frame1(g_intWho).Visible = False
    Unload Attrform
End Sub

Private Sub Form_Load()
    Dim intimgindex As Integer
    Dim strdrv As String
    
    Frame1(g_intWho).Visible = True

    Select Case g_intWho
    Case 0
      '选择图片
        Select Case drv.DriveType
        Case CDRom
            intimgindex = 5
        Case RamDisk
            intimgindex = 4
        Case Removable
            intimgindex = 3
        Case Network
            intimgindex = 9
        Case Unknown
            intimgindex = 4
        Case Fixed
            intimgindex = 4
        End Select
       Set imgIcon.Picture = frmFile.Imglarge.ListImages(intimgindex).Picture
       '填写驱动器的各种信息
       lblNamedrv.Caption = drv.DriveLetter + ":\"
       txtVol.Text = drv.VolumeName
        Select Case drv.DriveType
        Case CDRom
            strdrv = "光驱"
        Case RamDisk
            strdrv = "RAM"
        Case Removable
            strdrv = "软驱"
        Case Network
            strdrv = "网络驱动器"
        Case Unknown
            strdrv = "未知"
        Case Fixed
            strdrv = "本地磁盘"
        End Select
       lblTypedrv.Caption = strdrv
       lblTotal.Caption = CStr(drv.TotalSize / 1024 / 1024) + "M"
       lblSpace.Caption = CStr(drv.FreeSpace / 1024 / 1024) + "M"
       lblUsed.Caption = CStr((drv.TotalSize - drv.AvailableSpace) / 1024 / 1024) + "M"
       lblFS.Caption = drv.FileSystem
       
    Case 1 '文件夹
      Set imgfldr.Picture = frmFile.Imglarge.ListImages(6).Picture
      lblnamefldr.Caption = fldr.Name
      lblpathfldr.Caption = fldr.path
      lblTypefldr.Caption = fldr.Type
      lblSizefldr.Caption = CStr(fldr.Size / 1024) + "K"
      lblfldr.Caption = lblfldr.Caption + CStr(fldr.SubFolders.Count) + "个"
      lblfile.Caption = lblfile.Caption + CStr(fldr.Files.Count) + "个"
      lblshtnamefldr.Caption = fldr.ShortName
      lblshtpathfldr.Caption = fldr.ShortPath
      'lblcreatefldr.Caption = CStr(fldr.DateCreated)
      lbllstfldr.Caption = CStr(fldr.DateLastAccessed)
      lblmodifyfldr.Caption = CStr(fldr.DateLastModified)
      
      If (fldr.Attributes And ReadOnly) <> 0 Then
        chkreadfldr.Value = 1
      End If
      If (fldr.Attributes And Hidden) <> 0 Then
        chkhidefldr.Value = 1
      End If
      If (fldr.Attributes And System) <> 0 Then
        chksysfldr.Value = 1
      End If
      If (fldr.Attributes And Archive) <> 0 Then
        chkarchivefldr.Value = 1
      End If
      
      chksysfldr.Enabled = False
 
    Case 2
      Set imgfl.Picture = frmFile.Imglarge.ListImages(12).Picture
      lblnamefl.Caption = fl.Name
      lblpathfl.Caption = fl.path
      lbltypefl.Caption = fl.Type
      lblsizefl.Caption = CStr(fl.Size / 1024) + "K"
      lblshtnamefl.Caption = fl.ShortName
      lblshtpathfl.Caption = fl.ShortPath
      'lblcreatefl.Caption = CStr(fl.DateCreated)
      lbllastfl.Caption = CStr(fl.DateLastAccessed)
      lblmodifyfl.Caption = CStr(fl.DateLastModified)
      
      If (fl.Attributes And ReadOnly) <> 0 Then
        chkreadfl.Value = 1
      End If
      If (fl.Attributes And Hidden) <> 0 Then
        chkhidefl.Value = 1
      End If
      If (fl.Attributes And System) <> 0 Then
        chksysfl.Value = 1
      End If
      If (fl.Attributes And Archive) <> 0 Then
        chkarchivefl.Value = 1
      End If
      
      chksysfl.Enabled = False
     
    
    End Select
    
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -