现在的位置: 首页 > 程序开发 > 正文

用vb建立删除文件夹示例

2010年09月14日 程序开发 ⁄ 共 325字 ⁄ 字号 暂无评论

首先要[工程]-[引用] Microsoft Scriptting Runtime

Private Sub Command1_Click()
Dim fso As New FileSystemObject
If fso.FolderExists("c:abc") Then
  MsgBox ("文件夹已存在")
Else
  fso.CreateFolder ("c:abc")
End If
End Sub

Private Sub Command2_Click()
Dim fso As New FileSystemObject
If Not fso.FolderExists("c:abc") Then
  MsgBox ("文件夹不存在")
Else
  fso.DeleteFolder ("c:abc")
End If
End Sub

给我留言

留言无头像?


×