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

📄 form1003.frm

📁 VB实验教程源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "显示驱动器信息"
   ClientHeight    =   3090
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3090
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text1 
      Height          =   1455
      Left            =   1920
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   3
      Top             =   960
      Width           =   2415
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   360
      TabIndex        =   2
      Top             =   960
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "驱动器信息:"
      Height          =   375
      Left            =   1920
      TabIndex        =   1
      Top             =   360
      Width           =   1815
   End
   Begin VB.Label Label1 
      Caption         =   "驱动器:"
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   360
      Width           =   1335
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Fso As FileSystemObject
Dim Drv As Drive

Private Sub Combo1_Click()
'单击组合框驱动器
    Dim drvName As String
    drvName = Combo1.List(Combo1.ListIndex) & ":"
    Set Drv = Fso.GetDrive(Fso.GetDriveName(drvName))
    Text1.Text = "文件系统类型: " & Drv.FileSystem & Chr(13) + Chr(10)
    Text1.Text = Text1.Text & "总空间:" & Drv.TotalSize / 1024 & " K字节" & Chr(13) + Chr(10)
    Text1.Text = Text1.Text & "剩余空间:" & Drv.FreeSpace / 1024 & " K字节"
End Sub

Private Sub Form_Load()
'装载窗体
    Set Fso = CreateObject("Scripting.FileSystemObject")
    For Each Drv In Fso.Drives
    '显示驱动器名
        Combo1.AddItem Drv.DriveLetter
    Next
End Sub

⌨️ 快捷键说明

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