WinINET problem with ports > 32767

I would list all folders on a FTP server but the port of it is bigger then 32767 so I can't connect to it. I would solve it now by connecting to the server via Winsock. Could anyone tell me how I can list all folders (in a ListBox) on a server with Winsock?
Or have someone a solution for the port problem with WinINET?

Thank you for your support!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


has a number of tutorials including

which looks like it may be what you want.
barteltmAuthor Commented:
Sorry. But the samples dosn't work with port 39000 (in my example).
Well use the standard FTP port of 21 then???
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

barteltmAuthor Commented:
I havn't the control over the server.
The winsock control only accepts an integer for the port number,
so using this control will never work.

You either need to use something like C for better sockets control or ....
use IE as the transport, in VB use a webbrowser control and parse the output from the ftp site...

Here is a simplified html based solution, no error trapping added.

make a new project with 1 form,
add a control reference to microsoft internet controls,
draw a webbrowser on it

paste this code into the forms code area, change the variables and hit F5,
you'll have to parse the text from the document complete event,


Private Sub Form_Load()
    Dim port As Long
    port = 39000
    username = "username"
    password = "password"
    host = ""
    fp = FreeFile
    Open "c:\x.html" For Output As fp
    Print #fp, "<script>document.location = 'ftp://" & username & ":" & password & "@" & host & ":" & port & "';</script>"
    Close fp
    WebBrowser1.Navigate "c:\x.html"
End Sub

Private Sub WebBrowser1_DownloadComplete()
    MsgBox WebBrowser1.Document.body.innerHTML
End Sub


Have fun!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
No response from barteltm from 10/26/2003 comment
Award points to NeXus is recommend.
Please leave any comments here within the next seven days.

EE Cleanup Volunteer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming Languages-Other

From novice to tech pro — start learning today.