|
楼主 |
发表于 2010-3-16 20:26
|
显示全部楼层
关于自定义端口,原来的程序是默认使用21端口。如果要自定义端口的话,可以将InternetConnect函数的第3个参数改成你要的端口。
Public Function OpenConnection(sServer As String, sUser As String, sPassword As String) As Boolean
If hConnection <> 0 Then
InternetCloseHandle hConnection
End If
hConnection = InternetConnect(hOpen, sServer, INTERNET_INVALID_PORT_NUMBER, sUser, sPassword, INTERNET_SERVICE_FTP, dwSeman, 0)
If hConnection = 0 Then
ErrorOut Err.LastDllError, "InternetConnect"
OpenConnection = False
Exit Function
Else
OpenConnection = True
End If
End Function
改成:
hConnection = InternetConnect(hOpen, sServer, 3721, sUser, sPassword, INTERNET_SERVICE_FTP, dwSeman, 0) |
|