Aide:InetRead.txt

De Wiki AutoIt Français
Aller à : navigation, rechercher

Document original V3.3.6.1 :

###Function###
InetRead

###Description###
Downloads a file from the internet using the HTTP, HTTPS or FTP protocol.

###Syntax###
InetRead ( "URL" [, options ] )


###Parameters###
@@ParamTable@@
URL
	URL of the file to download.  See remarks below.
options
	[optional] 0 = (default) Get the file from local cache if available.
	1 = Forces a reload from the remote site.
	2 = Ignore all SSL errors (with HTTPS connections).
	4 = Use ASCII when transfering files with the FTP protocol (Can not be combined with flag 8).
	8 = Use BINARY when transfering files with the FTP protocol (Can not be combined with flag 4).  This is the default transfer mode if none are provided.
	16 = By-pass forcing the connection online (See remarks).
@@End@@


###ReturnValue###
@@ReturnTable@@
Success:	A binary string and @extended set to the number of bytes downloaded.
Failure:	Sets @error to non-zero and returns an empty string.
@@End@@


###Remarks###
Internet Explorer 3 or greater must be installed for this function to work.

The URL parameter should be in the form "http://www.somesite.com/path/file.html" - just like an address you would type into your web browser.

To use a username and password when connecting simply prefix the servername with "username:password@", e.g.
"http://myuser:mypassword@www.somesite.com"

The returned data is in binary format.  The <a href="BinaryToString.htm">BinaryToString()</a> function can be used to convert the data to a string.

By default AutoIt forces a connection before starting a download.  For dial-up users this will prompt to go online or dial the modem (depending on how the system is configured).  The options value 16 disables this behavior.  Disabling the behavior can be useful for persistent connects (Broadband, LAN).  However, it is also required to work around certain issues in Windows Vista and Windows 7.

###Related###
InetGet, InetGetSize, HttpSetProxy, FtpSetProxy, HttpSetUserAgent

###Example###
@@IncludeExample@@


Document traduit V3.3.6.1 :

###Function###
InetRead

###Description###
Télécharge un fichier depuis internet en utilisant le protocole HTTP, HTTPS ou FTP.


###Syntax###
InetRead ( "URL" [, options ] )


###Parameters###
@@ParamTable@@
URL
	URL du fichier à télécharger.  Voir les remarques ci-dessous.
options
	[optionnel] 0 = (défaut) Récupère le fichier depuis le cache local si disponible.
	1 = Force le rechargement depuis le site distant.
	2 = Ignore toutes les erreurs SSL (avec connexions HTTPS).
	4 = Utilise ASCII lors du transfert de fichiers avec le protocole FTP (Ne peut-être combiné avec l'option 8).
	8 = Utilise BINARY lors du transfert de fichiers avec le protocole FTP (Ne peut-être combiné avec l'option 4).  Ceci est le mode de transfert par défaut si aucun n'est fourni.
	16 = Force la connexion en ligne par contournement (Voir remarques).
@@End@@


###ReturnValue###
@@ReturnTable@@
Succès:	Une chaîne binaire et assigne à @extended le nombre d'octets téléchargés.
Échec:	Met @error <> 0 et retourne une chaîne vide.
@@End@@


###Remarks###
Internet Explorer 3 ou plus récent doit être installé pour faire fonctionner la fonction InetGet().

Le paramètre URL devrait être de la forme "http://www.lesite.com/chemin/fichier.html" - tout comme une adresse que vous tapez dans votre navigateur web.

Pour utiliser un nom d'utilisateur et un mot de passe lors de la connexion, préfixez simplement le nom de serveur avec "nomutilisateur:motdepasse@", e.g. "http://nomutilisateur:motdepasse@www.lesite.fr"

Les données retournées sont au format binaire.  La fonction <a href="BinaryToString.htm">BinaryToString()</a> peut-être utilisée pour convertir les données en chaîne.

Par défaut, AutoIt force une connexion avant de démarrer un téléchargement. Les utilisateurs de modems analogique seront invités à passer en ligne ou le numéro sera composé (selon la configuration du système). L'option de valeur 16 désactive ce comportement. Désactiver ce comportement peut-être utile pour les connexions continues (Large bande , LAN). Cependant, il est aussi nécessaire de travailler autour de certains problèmes dans Windows Vista et Windows 7.


###Related###
<a href="InetGet.htm">InetGet</a>, <a href="InetGetSize.htm">InetGetSize</a>, <a href="HttpSetProxy.htm">HttpSetProxy</a>, <a href="FtpSetProxy.htm">FtpSetProxy</a>, <a href="HttpSetUserAgent.htm">HttpSetUserAgent</a>


###Example###
@@IncludeExample@@


Traducteur : Alex74

Contributeurs (pour les modifications avant le Wiki) : Tlem