Solved

WinINET problem with ports > 32767

Posted on 2003-10-22
7
289 Views
Last Modified: 2013-11-13
Hi.
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!
0
Comment
Question by:barteltm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Expert Comment

by:Dang123
ID: 9600139

http://www.vbip.com/ 

has a number of tutorials including

http://www.vbip.com/protocols/ftp/vb-ftp-client-library/tutorials/tutorial-03.asp

which looks like it may be what you want.
0
 

Author Comment

by:barteltm
ID: 9600406
Sorry. But the samples dosn't work with port 39000 (in my example).
0
 
LVL 5

Expert Comment

by:dc197
ID: 9602710
Well use the standard FTP port of 21 then???
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:barteltm
ID: 9604308
I havn't the control over the server.
0
 
LVL 1

Accepted Solution

by:
NeXus earned 125 total points
ID: 9624780
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 = "www.myftpserver.com"
   
    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!
0
 
LVL 27

Expert Comment

by:planocz
ID: 10154652
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.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

planocz
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question