?
Solved

WinINET problem with ports > 32767

Posted on 2003-10-22
7
Medium Priority
?
300 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 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
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…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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…
Suggested Courses

765 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