已有文件夹E:\KKK
想在kkk中再新建一个子文件夹
e:\kkk\aaa\
aaa是通过 text1.text中的内容得到的
就是说text1.text中是什么那就新建一个叫什么名字的文件夹
例text1.text=你好则新建e:\kkk\你好\如text1.text=今天则新建eee:\kkk\今天\
谢了
想在kkk中再新建一个子文件夹
e:\kkk\aaa\
aaa是通过 text1.text中的内容得到的
就是说text1.text中是什么那就新建一个叫什么名字的文件夹
例text1.text=你好则新建e:\kkk\你好\如text1.text=今天则新建eee:\kkk\今天\
谢了
解决方案 »
- 关于两个MDI界面在一个项目中分别调用的问题
- 如何使无边框窗口最大化后不遮住任务栏呀?
- 高人指点!如何利用vb访问我放在租用的web服务器上的access数据库
- vb中的程序休眠是什么函数?就是 sleep(1000)...vb中怎么写?
- vb ado直接操作数据库,要屏蔽的sql特殊符号吃了单引号外还要屏蔽什么?为什么?谢谢
- 请教各位,如何将我得到的数组内容生成文件?
- 谁能给我讲一下数据结构中的搜索?就这点分了,谢先!
- 关于dbf数据的压缩
- 我要在一个表中查找符合条件的记录。然后把它们全部导入另外一个表中,在将它们删除。用ado和sql怎么写?
- 为什么我的MDI父窗体里只能放进一个子窗体
- 求高手帮忙写一段更改IDE磁盘控制器的代码
- 如何用VB登陆集成WINDOWS验证的网页.
Dim s As String
s = "e:\kkk"
If Dir(s, vbDirectory) = "" Then
MkDir s
End If
MkDir s & "\" & Text1.Text
End Sub
Private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (ByVal lpPathName As String, lpSecurityAttributes As SECURITY_ATTRIBUTES) As Long
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type '创建目录
Public Function CreateNewDirectory(NewDirectory As String) As String
Dim sDirTest As String
Dim SecAttrib As SECURITY_ATTRIBUTES
Dim bSuccess As Boolean
Dim sPath As String
Dim iCounter As Integer
Dim sTempDir As String
Dim iFlag As Integer
iFlag = 0
sPath = NewDirectory If Mid(sPath, Len(sPath) - 1) <> "\" Then
sPath = sPath & "\"
End If iCounter = 1
Do Until InStr(iCounter, sPath, "\") = 0
iCounter = InStr(iCounter, sPath, "\")
sTempDir = Mid(sPath, 1, iCounter)
sDirTest = Dir(sTempDir)
iCounter = iCounter + 1 SecAttrib.lpSecurityDescriptor = &O0
SecAttrib.bInheritHandle = False
SecAttrib.nLength = Len(SecAttrib)
bSuccess = CreateDirectory(sTempDir, SecAttrib)
Loop
CreateNewDirectory = NewDirectory
End Function