Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

InternetConnect.. Ftp Site Not on Line. Hangs!!

Status
Not open for further replies.

TURNERMICH

Technical User
Apr 5, 2000
64
AU
I am connecting to an FTP site. using "wininet.dll"


1.
hOpen = InternetOpen(scUserAgent, INTERNET_OPEN_TYPE_DIRECT, vbNullString, vbNullString, 0)

If hOpen = 0 Then
MsgBox ("Internet Not Connected...")
Exit Sub
End If
========This is ok==============================

2.
hConnection = InternetConnect(hOpen, TxtServer, INTERNET_INVALID_PORT_NUMBER, _
TxtUser, TxtPassWord, INTERNET_SERVICE_FTP, nFlag, 0)
If hConnection = 0 Then
MsgBox ("Error Connecting to Internet")
Exit Sub
End If

If the TxtServer is a valid ip connection, and alive., it works fine.

But... If the Ip address is invalid, or the sites ftp server is not running,

It just keeps trying to connect, and i have to ctrl/alt/del, and end task.


I have tried various samples of code using this call, and they ALL just hang. ie. the error trap does
not work.!!!!

Appreciate any help.
 
Have worked out the problem,
should be
INTERNET_DEFAULT_FTP_PORT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top