CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 1999
    Location
    California, USA
    Posts
    40

    How do i create a directory??????

    Hey peoplez! i need to make a directory, but first i need to no how!!!!!!!!! Please help me, if you want to no what i am doing read below:

    First i made a splash screen then when you click or push a button, it goes to a password dialog box and asks for a password, when you type the right one in it takes you to a form, when i go to my forms code thing under "unload" i put
    open "c:\phonebook\list.lst" for append as #1, that statement tells the program to write to a file when the user exits my program, but it says "path not found". I need to make it so it creates the directoy "c:\phonebook\" only 1 time. Please oh please help me

    PanasonicSubz

  2. #2
    Guest

    Re: How do i create a directory??????

    If you need just Directory, you can use API CreateDirectory. If you need to use second argument, look for info about SECURITY_ATTRIBUTES. If no, use this ugly code:

    private Declare Function CreateDirectory Lib "kernel32" Alias "CreateDirectoryA" (byval lpPathName as string, lpSecurityAttributes as SECURITY_ATTRIBUTES) as Long
    private Type SECURITY_ATTRIBUTES
    s as string
    End Type


    private Sub Command1_Click()
    Dim l as Long
    Dim sa as SECURITY_ATTRIBUTES
    l = CreateDirectory("D:\TEEEST", sa)'it creates a folder TEEEST on drive D.
    End Sub



    HTH
    Vlad




  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: How do i create a directory??????

    vb has a builtin MkDir function.
    mkdir "yourSubDirNameGoesHere"


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured