Solved

WinINET problem with ports > 32767

Posted on 2003-10-22
7
287 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
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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sending a email via excel using vba 6 97
Prevent user closing word document opened with VB6 6 78
Dinamic report to Crosstab query 9 33
transition to visual .net from vb6 5 37
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This video teaches viewers about errors in exception handling.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

856 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