1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| gsRésultatest est une chaîne
RES est un Buffer
sAgent est une chaîne = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36"
ResConnexion est un booléen
// Vérification de connexion internet
ResConnexion = InternetConnecté()
SI ResConnexion = Vrai ALORS
Info("Une connexion Internet est active")
SINON
Info("Aucune connexion Internet n'est active")
FIN
// passage de paramètre
HTTPParamètre(httpParamètreMode,1)
HTTPParamètre(httpParamètreDésactiveCookie,0)
HTTPParamètre(httpParamètreDésactiveCache,0)
HTTPCréeFormulaire("form")
HTTPAjouteParamètre("form","LOGIN","Name%40domaine.com")
HTTPAjouteParamètre("form","PASSWORD","mpass")
HTTPAjouteParamètre("form","callContext","loginPage")
HTTPEnvoieFormulaire("form","http://DomaineName/connexion/login.json",httpPost,sAgent)
SI HTTPEnvoieFormulaire("form","http://DomainName/connexion/login.json",httpPost,sAgent)=Vrai ALORS
Info("vous etes bien connecté")
SINON
Erreur("Non Connecté")
FIN
SI ErreurDétectée ALORS
Erreur(ErreurInfo(errComplet))
SINON
HTTPRequête("http://DomainName/fr_FR/main.html#inbox")
RES=HTTPDonneRésultat(httpRésultat)
Info(RES)
FIN
//vérification des données reçus
fSauveBuffer("C:\mostadi\mostadi.txt",RES) |
Partager