用createdirectory创建文件夹
2002-10-10 09:38
323 查看
用createdirectory创建文件夹。(原创)
Private Sub Command1_Click()
Private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
Dim attribut As SECURITY_ATTRIBUTES
attribut.nLength = Len(attribut)
attribut.lpSecurityDescriptor = &O0
attribut.bInheritHandle = False
Dim counter As Long
Dim tnew As String
Dim onew As String
Dim i As Long
Dim lnew As Long
Dim tx As String
Dim mi As String
Dim minstra As Long
Dim a As String
a = InputBox("请输入要创建的文件夹名", "创建文件夹名")
counter = 0
If Right(a, 1) <> "/" Then
a = a & "/"
End If
lnew = Len(a)
For i = 1 To lnew
tx = Left(a, i)
If Len(tx) > 3 Then
mi = Right(tx, 1)
If mi = "/" Then
Call CreateDirectory(tx, attribut)
End If
End If
Next i
end sub
Private Sub Command1_Click()
Private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
Dim attribut As SECURITY_ATTRIBUTES
attribut.nLength = Len(attribut)
attribut.lpSecurityDescriptor = &O0
attribut.bInheritHandle = False
Dim counter As Long
Dim tnew As String
Dim onew As String
Dim i As Long
Dim lnew As Long
Dim tx As String
Dim mi As String
Dim minstra As Long
Dim a As String
a = InputBox("请输入要创建的文件夹名", "创建文件夹名")
counter = 0
If Right(a, 1) <> "/" Then
a = a & "/"
End If
lnew = Len(a)
For i = 1 To lnew
tx = Left(a, i)
If Len(tx) > 3 Then
mi = Right(tx, 1)
If mi = "/" Then
Call CreateDirectory(tx, attribut)
End If
End If
Next i
end sub
相关文章推荐
- VC与Delphi之间动态链接库互相调用
- delphi中的时间操作技术(1)
- delphi中的时间操作技术(2)
- IP地址的隐藏(delphi实现 )
- 解析IP地址为主机域名
- 将某一主机域名解析为IP地址
- 使用 .NET 框架将现有代码作为 Web 服务提供
- 用VB和MTS开发多层数据库应用系统
- 使用C#开发COM+组件
- DOM心得
- 用Socket发送电子邮件
- VB计算农历的算法
- 用MCI命令做一个播放器
- MCI播放器在VB中实现
- Netscaler数据索引String Map与Pattern Set的区别
- 关于LoadRunner压测过程中出现的error26601的解释
- Monkey基本用法与常用参数 推荐
- MySQL - undefined function mysql_connect()
- How To Create Shared Disks By VBoxManage Command