用createdirectory创建文件夹

[入库:2005年8月18日] [更新:2007年3月24日]

本文简介:选择自 ywchen2000 的 blog

  用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

本文关键:api
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top