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

📄 form1.frm

📁 本文件包含200个visual baisc实例
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "判断驱动器"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command1 
      Caption         =   "判断驱动器"
      Height          =   495
      Left            =   1095
      TabIndex        =   2
      Top             =   1710
      Width           =   2295
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   495
      Left            =   1095
      TabIndex        =   1
      Top             =   2430
      Width           =   2295
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      BackColor       =   &H00C0C0FF&
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   18
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1095
      TabIndex        =   0
      Text            =   "c"
      Top             =   990
      Width           =   2295
   End
   Begin VB.Label Label1 
      ForeColor       =   &H000000C0&
      Height          =   375
      Left            =   1110
      TabIndex        =   3
      Top             =   465
      Width           =   2295
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'函数声明
Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long

Private Sub Command1_Click()
  Dim k
  Dim i
  Dim r
  k = Text1.Text + ":\"
  r = GetDriveType(k)
  Select Case r
         Case 2
         Label1.Caption = "这是软盘"
         Case 3
         Label1.Caption = "这是硬盘"
         Case 4
         Label1.Caption = "这是网络映射盘"
         Case 5
         Label1.Caption = "这是光驱"
         Case 6
         Label1.Caption = "这是RAM DISK"
         Case Else
         Label1.Caption = "不知道的设备"
  End Select
End Sub

Private Sub Command2_Click()
  End
End Sub

⌨️ 快捷键说明

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