I ran this code through the upgrade wizard from VB6 to VB.net and this was the result. I noticed that the data types have been changed from Longs to Integers however I changed tried changing them back to Longs with no success.
The first piece of code is from my form and is the line which attempts to make the connection.
<code>
hConnection = InternetConnect(hOpen, "ftp.mysite.com", INTERNET_INVALID_PORT_NUMBER, "user", "password", INTERNET_SERVICE_FTP, dwSeman, 0)
</code>
<code>
Public Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" _
(ByVal hInternetSession As Integer, ByVal sServerName As String, ByVal nServerPort As Short, ByVal sUsername As String, ByVal sPassword As String, ByVal lService As Integer, ByVal lFlags As Integer, ByVal lContext As Integer) As Integer
Public Declare Function InternetCloseHandle Lib "wininet.dll" _
(ByVal hInet As Integer) As Integer
Public Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" _
(ByVal sAgent As String, ByVal lAccessType As Integer, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Integer) As Integer
</code>