pexam12_1.frm

来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 158 行

FRM
158
字号
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   2910
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3795
   LinkTopic       =   "Form1"
   ScaleHeight     =   2910
   ScaleWidth      =   3795
   StartUpPosition =   3  '窗口缺省
   Begin MSComDlg.CommonDialog CommonDialog1 
      Left            =   3240
      Top             =   840
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CheckBox Check2 
      Caption         =   "隐藏"
      Height          =   375
      Left            =   2520
      TabIndex        =   9
      Top             =   2280
      Width           =   735
   End
   Begin VB.CheckBox Check1 
      Caption         =   "只读"
      Height          =   375
      Left            =   1200
      TabIndex        =   8
      Top             =   2280
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   1320
      TabIndex        =   1
      Text            =   "Text1"
      Top             =   120
      Width           =   2295
   End
   Begin VB.Label Label9 
      Caption         =   "字节"
      Height          =   255
      Left            =   2640
      TabIndex        =   11
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label8 
      Caption         =   "属性:"
      Height          =   375
      Left            =   120
      TabIndex        =   10
      Top             =   2280
      Width           =   615
   End
   Begin VB.Label Label7 
      Height          =   255
      Left            =   1320
      TabIndex        =   7
      Top             =   1800
      Width           =   2055
   End
   Begin VB.Label Label6 
      Caption         =   "创建时间:"
      Height          =   255
      Left            =   120
      TabIndex        =   6
      Top             =   1800
      Width           =   975
   End
   Begin VB.Line Line3 
      X1              =   120
      X2              =   3600
      Y1              =   2160
      Y2              =   2160
   End
   Begin VB.Label Label5 
      Height          =   255
      Left            =   1200
      TabIndex        =   5
      Top             =   1200
      Width           =   1095
   End
   Begin VB.Line Line2 
      X1              =   120
      X2              =   3600
      Y1              =   1680
      Y2              =   1680
   End
   Begin VB.Label Label4 
      Caption         =   "大小:"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label Label3 
      Height          =   255
      Left            =   1320
      TabIndex        =   3
      Top             =   720
      Width           =   855
   End
   Begin VB.Label Label2 
      Caption         =   "位置:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   720
      Width           =   855
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   3600
      Y1              =   600
      Y2              =   600
   End
   Begin VB.Label Label1 
      Caption         =   "文件名称:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   240
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Form_Load()
  Dim filename As String
  '打开通用对话框
  CommonDialog1.ShowOpen
  '获得文件名
  filename = CommonDialog1.filename
  '显示文件名
  Text1.Text = filename
  '获得选中文件所在的驱动器
  Label3.Caption = Left(CurDir(filename), 3)
  '获得文件长度
  Label5.Caption = FileLen(filename)
  '获得文件创建时间
  Label7.Caption = FileDateTime(filename)
  '判断文件是否具有只读属性
  Check1.Value = GetAttr(filename) And vbReadOnly
  '判断文件是否为隐藏文件
  Check2.Value = GetAttr(filename) And vbHidden
End Sub

⌨️ 快捷键说明

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