FTP Treeview Control Browser Using API-VBForums
Results 1 to 4 of 4

Thread: FTP Treeview Control Browser Using API

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2016
    Posts
    18

    FTP Treeview Control Browser Using API

    I am wanting to develop a Browser for FTP files & folders using a Treeview made by using API. I have been able to get the first levels Files/folders to show up but not Child Nodes. Is there already an API function that shows FTP files and Folders? For example, can a person use the SHGetFolderLocation routine list here to show FTP Files/Folders instead of local drive Files/Folders.

    P.S. I am currently using a standard Listbox to show FTP files & Folders, but this only shows one level at a time compared to multiple levels that a Treeview control could show.

    Thanks in advance for any useful help.

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,105

    Re: FTP Treeview Control Browser Using API

    Below is a link to a VB6-CodeBank-entry, where a TreeView-Control is used, to show the serverside FTP-Directories -
    maybe it's useful to look how it's done there...

    http://www.vbforums.com/showthread.p...Winsock-ocx%29

    Olaf

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2016
    Posts
    18

    Re: FTP Treeview Control Browser Using API

    I looked through this for a while and even pulled up the Visual Basic files to look at the code. All of this would probably work if I could load additional OCX files. I am using Visual Basic 5 in Windows 10. It will not let me add any additional controls that were not pre-loaded into the program. I keep getting errors like "Permission Denied" or "unable to access registry" even though this is on my personal computer at home with full administrative rights. This includes not being able to load Common Dialog Controls 5 or 6, etc. I have to make a Treeview using API commands. A "name" cannot be attached or accessed to the Treeview control when using API - only a handle to the Window that creates the Treeview. In other words, using API, I cannot get the Treeview control to be named Treeview1, Treeview2, etc. The handle is a "long", not a string like "Treeview1".

    Maybe at this point the question should be...is there some kind of functions that can sort through folders to know that a folder contains more folders or files. For example, let's say there are 3 folders on the entry level called "Genesis", "Exodus", "Leviticus". I doubleclick on Exodus to open it up and it contains 2 Folders called "Chapter 1" & "Chapter 2". Is there a routine that starts at the top level and works it's way through all the folders to know (in this example), Exodus contained 2 folders? If I can come up with this routine, I can use my current FTP functions of accessing top level folders to add multiple layers to the Treeview control. (Currently, I can access one level of folders at a time using a Listbox but would like to use a Treeview control for multiple levels).

    OR... is there a way of using the BROWSEINFO structure with SHGetFolderPath to access FTP files & folders? Seems to me, SHGetFolderPath can only be used on Local Folders/Files, not FTP Folders/Files.

    Hope all this is not too confusing.

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    3,105

    Re: FTP Treeview Control Browser Using API

    Quote Originally Posted by ChildOfTheKing View Post
    ...is there some kind of functions that can sort through folders to know that a folder contains more folders or files...
    In the linked Source-Code, there should be a parsing-routine, which is
    looping through the return-text of the FTP-List command (filling the
    current Tree-Node with additional entries, depending on - if the "List"ed
    text-line of the FTP-Server-Command-return was a directory or a file...

    You don't need to do a "deep-scan" for FTP-folders/files already after connecting...
    It is enough, to only fill the current Tree-Node (which after connect is the Tree-Root-Node).

    All other nodes can be populated "on demand" (after double-clicking them in the Tree-View,
    followed by issuing the next List-command on the directory in question).

    Olaf

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.