Solved

WinINET problem with ports > 32767

Posted on 2003-10-22
7
280 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
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.
This video teaches viewers about errors in exception handling.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now