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

📄 wen4.frm

📁 这是一个文件管理器
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form4 
   Caption         =   "文件属性"
   ClientHeight    =   1845
   ClientLeft      =   45
   ClientTop       =   270
   ClientWidth     =   2670
   LinkTopic       =   "Form5"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   ScaleHeight     =   1845
   ScaleWidth      =   2670
   StartUpPosition =   3  '窗口缺省
   Begin VB.CheckBox Check1 
      Caption         =   "只  读"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   240
      TabIndex        =   3
      Top             =   360
      Width           =   972
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取消"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   1440
      TabIndex        =   2
      Top             =   1440
      Width           =   1092
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确定"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   372
      Left            =   120
      TabIndex        =   1
      Top             =   1440
      Width           =   1092
   End
   Begin VB.Frame Frame1 
      Caption         =   "文件属性"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1212
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2412
      Begin VB.CheckBox Check4 
         Caption         =   "常  规"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   372
         Left            =   1320
         TabIndex        =   6
         Top             =   720
         Width           =   972
      End
      Begin VB.CheckBox Check3 
         Caption         =   "系  统"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   372
         Left            =   120
         TabIndex        =   5
         Top             =   720
         Width           =   972
      End
      Begin VB.CheckBox Check2 
         Caption         =   "隐  藏"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   9
            Charset         =   134
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   372
         Left            =   1320
         TabIndex        =   4
         Top             =   240
         Width           =   972
      End
   End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Command1_Click()
    Dim setattr As Integer
    setattr = 0 '属性变量初始化
    '依次累加属性值
    If Check4.Value Then setattr = setattr + 0
    If Check1.Value Then setattr = setattr + 1
    If Check2.Value Then setattr = setattr + 2 + 32
    If Check3.Value Then setattr = setattr + 4
    SetFileAttributes curFile, setattr
    Form1.File1.Refresh '文件列表更新,若为文件设置了隐藏属性,就看不到了
    Unload Form4
End Sub

Private Sub Command2_Click()
    Unload Form4
End Sub

Private Sub Form_Load()
    Dim fileAttr As Integer
    If curFile <> "" Then   '如果选中的是文件
        Check1.Value = 0    '文件属性初始化
        Check2.Value = 0
        Check3.Value = 0
        Check4.Value = 0
        fileAttr = GetAttr(curFile) '读取被选文件的属性
        '对文件属性作出判断,设置对应的属性检查框
        If (fileAttr = 0) Or (fileAttr = 32) Then Check4.Value = 1
  
        If (fileAttr = 1) Or (fileAttr = 33) Then Check1.Value = 1

        If (fileAttr = 2) Or (fileAttr = 34) Then Check2.Value = 1
  
        If (fileAttr = 4) Or (fileAttr = 36) Then Check3.Value = 1
 
        If (fileAttr = 3) Or (fileAttr = 35) Then
            Check2.Value = 1: Check1.Value = 1
        End If
 
        If (fileAttr = 5) Or (fileAttr = 37) Then
            Check1.Value = 1: Check3.Value = 1
        End If
 
        If (fileAttr = 6) Or (fileAttr = 38) Then
            Check2.Value = 1: Check3.Value = 1
        End If
  
        If (fileAttr = 7) Or (fileAttr = 39) Then
            Check1.Value = 1: Check2.Value = 1: Check3.Value = 1
        End If
 
    Else
        MsgBox "请选中一个文件", vbOKOnly
    End If
End Sub

⌨️ 快捷键说明

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