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

📄 frmmain.frm

📁 一个可以移动文件和文件夹的系统,在这个系统中,你可以方便的在一个界面内创建,复制和移动文件和文件夹
💻 FRM
📖 第 1 页 / 共 2 页
字号:
      End
      Begin VB.DirListBox Dir3 
         Height          =   930
         Left            =   4560
         TabIndex        =   23
         Top             =   1320
         Width           =   3375
      End
      Begin VB.DriveListBox Drive3 
         Height          =   300
         Left            =   3960
         TabIndex        =   12
         Top             =   480
         Width           =   1515
      End
      Begin VB.CommandButton Command3 
         Caption         =   "删除文件"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   6480
         TabIndex        =   9
         Top             =   480
         Width           =   1455
      End
      Begin VB.CommandButton Command1 
         Caption         =   "新建文件"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   495
         Left            =   360
         TabIndex        =   8
         Top             =   480
         Width           =   1455
      End
      Begin VB.TextBox Text2 
         Height          =   270
         Left            =   6600
         TabIndex        =   7
         Top             =   2520
         Width           =   1335
      End
      Begin VB.TextBox Text1 
         Height          =   270
         Left            =   2160
         TabIndex        =   5
         Top             =   2520
         Width           =   2175
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         Caption         =   "目录"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   24
         Top             =   960
         Width           =   690
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         Caption         =   "新子文件夹名称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   4560
         TabIndex        =   6
         Top             =   2520
         Width           =   2115
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         Caption         =   "新文件夹名称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   360
         TabIndex        =   4
         Top             =   2520
         Width           =   1815
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         Caption         =   "驱动器"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   14.25
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   -1  'True
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   2880
         TabIndex        =   3
         Top             =   480
         Width           =   975
      End
   End
   Begin VB.CommandButton Command2 
      Caption         =   "复制文件"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   14.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   8160
      Width           =   1455
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      Caption         =   "同一台机子上的文件操作"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   2520
      TabIndex        =   1
      Top             =   960
      Width           =   3855
   End
End
Attribute VB_Name = "frmmain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
   Set fso = CreateObject("Scripting.FileSystemObject")
   If Option1.Value Then
      Set fs = fso.CreateFolder(Dir3.Path & Trim(Text1.Text))
      Set zs = fso.CreateFolder(Dir3.Path & Trim(Text1.Text) & "\" & _
               Trim(Text2.Text))
   ElseIf Option2.Value Then
      Text1.Enabled = False
      Text1.Text = Dir3.Path
      Set zs = fso.CreateFolder(Dir3.Path & "\" & Trim(Text2.Text))
   Else
      MsgBox "请先选择所建文件夹类型!", 48 + vbOKOnly, "提示"
      Text1.Text = ""
      Text2.Text = ""
   End If
   Text1.Enabled = True
   Command1.Enabled = False
End Sub

Private Sub Command2_Click()
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.CopyFolder Dir2.Path, Dir1.Path
   Command2.Enabled = False
End Sub

Private Sub Command3_Click()
   Set fso = CreateObject("Scripting.FileSystemObject")
   fso.DeleteFolder Dir3.Path
   Command3.Enabled = False
End Sub

Private Sub Command4_Click()
   Text1.Text = ""
   Text2.Text = ""
End Sub

Private Sub Command5_Click()
   End
End Sub

Private Sub Command6_Click()
   frmmain.Hide
   frminstruction.Show
End Sub

Private Sub Dir2_Change()
   Command2.Enabled = True
End Sub

Private Sub Dir3_Change()
   Command3.Enabled = True
End Sub

Private Sub Drive1_Change()
   Dir1.Path = Drive1.Drive
End Sub

Private Sub Drive2_Change()
   Dir2.Path = Drive2.Drive
End Sub

Private Sub Drive3_Change()
   Dir3.Path = Drive3.Drive
End Sub

Private Sub Form_Load()
   Command1.Enabled = False
End Sub

Private Sub Option1_Click()
   Text1.Enabled = True
   Text1.SetFocus
   MsgBox "所建的文件夹位于右边所选目录中!", 48 + vbOKOnly, "注意"
End Sub

Private Sub Option2_Click()
   Text1.Enabled = False
   Text2.SetFocus
   MsgBox "请在右边目录中选择所建文件夹位置!", 48 + vbOKOnly, "注意"
End Sub

Private Sub Text2_Change()
   Command1.Enabled = True
End Sub

⌨️ 快捷键说明

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