je tente d'utiliser les API de wininet.dll, et ça
commence mal ( pour moi ). par exemple :
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
retourne Ftp=0.
( j'ai essayé sur mon site avec un nom d'utilisateur
et un mot de passe, même punition. )
je tente d'utiliser les API de wininet.dll, et ça
commence mal ( pour moi ). par exemple :
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
retourne Ftp=0.
( j'ai essayé sur mon site avec un nom d'utilisateur
et un mot de passe, même punition. )
je tente d'utiliser les API de wininet.dll, et ça
commence mal ( pour moi ). par exemple :
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
retourne Ftp=0.
( j'ai essayé sur mon site avec un nom d'utilisateur
et un mot de passe, même punition. )
j'abuse mais :
Err.LastDllError me donne l'erreur 12007
et "où c'est-y que" je trouve la signification ?
j'abuse mais :
Err.LastDllError me donne l'erreur 12007
et "où c'est-y que" je trouve la signification ?
j'abuse mais :
Err.LastDllError me donne l'erreur 12007
et "où c'est-y que" je trouve la signification ?
je vais regarder cela... merci
pas de firewall
Windows 98 + Visual Basic 5
ça explique ?
je vais regarder cela... merci
pas de firewall
Windows 98 + Visual Basic 5
ça explique ?
je vais regarder cela... merci
pas de firewall
Windows 98 + Visual Basic 5
ça explique ?
merci François Picalausa de répondre
voici la source (simplifiée pour essais) :
Private Declare Function InternetOpen _
Lib "wininet.dll" Alias "InternetOpenA" ( _
ByVal sAgent As String, _
ByVal lAccessType As Long, _
ByVal sProxyName As String, _
ByVal sProxyBypass As String, _
ByVal lFlags As Long) As Long
Const INTERNET_FLAG_ASYNC = &H10000000 'Les requêtes sont effectuées
asynchrones.
Const INTERNET_FLAG_FROM_CACHE = &H1000000 'Les requêtes sont effectuées
partir du cache, si l'élément n'est pas dans le cache, une erreur est
retournée.
Const INTERNET_FLAG_OFFLINE = &H1000000 'Identique à
INTERNET_FLAG_FROM_CACHE.
Const INTERNET_OPEN_TYPE_DIRECT = 1 'Résoud les noms en local.
Const INTERNET_OPEN_TYPE_PRECONFIG = 0 'Récupère la configuration par
défaut (base de registre).
Const INTERNET_OPEN_TYPE_PROXY = 3 'Envoi des requêtes au proxy,
sauf pour les exceptions indiquées dans sProxyBypass.
Private Declare Function InternetConnect _
Lib "wininet.dll" Alias "InternetConnectA" ( _
ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUsername As String, _
ByVal sPassword As String, _
ByVal lService As Long, _
ByVal lFlags As Long, _
ByVal lContext As Long) As Long
Const INTERNET_DEFAULT_FTP_PORT = 21 'Port FTP par défaut.
Const INTERNET_DEFAULT_GOPHER_PORT = 70 'Port Gopher par défaut.
Const INTERNET_DEFAULT_HTTP_PORT = 80 'Port HTTP par défaut.
Const INTERNET_DEFAULT_HTTPS_PORT = 443 'Port HTTPS par défaut.
Const INTERNET_DEFAULT_SOCKS_PORT = 1080 'Port Socks (firewall) par
défaut.
Const INTERNET_SERVICE_FTP = 1 'Service FTP.
Const INTERNET_SERVICE_GOPHER = 2 'Service Gopher.
Const INTERNET_SERVICE_HTTP = 3 'Service HTTP.
Dim Ftp, Session As Long
Option Explicit
Private Sub Command1_Click()
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
MsgBox Err.LastDllError
End Sub
merci François Picalausa de répondre
voici la source (simplifiée pour essais) :
Private Declare Function InternetOpen _
Lib "wininet.dll" Alias "InternetOpenA" ( _
ByVal sAgent As String, _
ByVal lAccessType As Long, _
ByVal sProxyName As String, _
ByVal sProxyBypass As String, _
ByVal lFlags As Long) As Long
Const INTERNET_FLAG_ASYNC = &H10000000 'Les requêtes sont effectuées
asynchrones.
Const INTERNET_FLAG_FROM_CACHE = &H1000000 'Les requêtes sont effectuées
partir du cache, si l'élément n'est pas dans le cache, une erreur est
retournée.
Const INTERNET_FLAG_OFFLINE = &H1000000 'Identique à
INTERNET_FLAG_FROM_CACHE.
Const INTERNET_OPEN_TYPE_DIRECT = 1 'Résoud les noms en local.
Const INTERNET_OPEN_TYPE_PRECONFIG = 0 'Récupère la configuration par
défaut (base de registre).
Const INTERNET_OPEN_TYPE_PROXY = 3 'Envoi des requêtes au proxy,
sauf pour les exceptions indiquées dans sProxyBypass.
Private Declare Function InternetConnect _
Lib "wininet.dll" Alias "InternetConnectA" ( _
ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUsername As String, _
ByVal sPassword As String, _
ByVal lService As Long, _
ByVal lFlags As Long, _
ByVal lContext As Long) As Long
Const INTERNET_DEFAULT_FTP_PORT = 21 'Port FTP par défaut.
Const INTERNET_DEFAULT_GOPHER_PORT = 70 'Port Gopher par défaut.
Const INTERNET_DEFAULT_HTTP_PORT = 80 'Port HTTP par défaut.
Const INTERNET_DEFAULT_HTTPS_PORT = 443 'Port HTTPS par défaut.
Const INTERNET_DEFAULT_SOCKS_PORT = 1080 'Port Socks (firewall) par
défaut.
Const INTERNET_SERVICE_FTP = 1 'Service FTP.
Const INTERNET_SERVICE_GOPHER = 2 'Service Gopher.
Const INTERNET_SERVICE_HTTP = 3 'Service HTTP.
Dim Ftp, Session As Long
Option Explicit
Private Sub Command1_Click()
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
MsgBox Err.LastDllError
End Sub
merci François Picalausa de répondre
voici la source (simplifiée pour essais) :
Private Declare Function InternetOpen _
Lib "wininet.dll" Alias "InternetOpenA" ( _
ByVal sAgent As String, _
ByVal lAccessType As Long, _
ByVal sProxyName As String, _
ByVal sProxyBypass As String, _
ByVal lFlags As Long) As Long
Const INTERNET_FLAG_ASYNC = &H10000000 'Les requêtes sont effectuées
asynchrones.
Const INTERNET_FLAG_FROM_CACHE = &H1000000 'Les requêtes sont effectuées
partir du cache, si l'élément n'est pas dans le cache, une erreur est
retournée.
Const INTERNET_FLAG_OFFLINE = &H1000000 'Identique à
INTERNET_FLAG_FROM_CACHE.
Const INTERNET_OPEN_TYPE_DIRECT = 1 'Résoud les noms en local.
Const INTERNET_OPEN_TYPE_PRECONFIG = 0 'Récupère la configuration par
défaut (base de registre).
Const INTERNET_OPEN_TYPE_PROXY = 3 'Envoi des requêtes au proxy,
sauf pour les exceptions indiquées dans sProxyBypass.
Private Declare Function InternetConnect _
Lib "wininet.dll" Alias "InternetConnectA" ( _
ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUsername As String, _
ByVal sPassword As String, _
ByVal lService As Long, _
ByVal lFlags As Long, _
ByVal lContext As Long) As Long
Const INTERNET_DEFAULT_FTP_PORT = 21 'Port FTP par défaut.
Const INTERNET_DEFAULT_GOPHER_PORT = 70 'Port Gopher par défaut.
Const INTERNET_DEFAULT_HTTP_PORT = 80 'Port HTTP par défaut.
Const INTERNET_DEFAULT_HTTPS_PORT = 443 'Port HTTPS par défaut.
Const INTERNET_DEFAULT_SOCKS_PORT = 1080 'Port Socks (firewall) par
défaut.
Const INTERNET_SERVICE_FTP = 1 'Service FTP.
Const INTERNET_SERVICE_GOPHER = 2 'Service Gopher.
Const INTERNET_SERVICE_HTTP = 3 'Service HTTP.
Dim Ftp, Session As Long
Option Explicit
Private Sub Command1_Click()
Session = InternetOpen("exemple", 1, vbNullString, _
vbNullString, 0)
Ftp = InternetConnect(Session, "ftp://ftp.borland.com", 21, _
"anonymous", "anonymous", _
1, 0, 0)
MsgBox Err.LastDllError
End Sub