Code : Tout sélectionner
#include <FTPEx.au3>
#include <file.au3>
SplashTextOn("", "connexion au serveur ftp en cours...")
$serv="ftplpas.comule.com"
$user=""
$pass=""
$db="/db.ini"
$db1="public_html/db.ini"
$connexion=_FTP_Open("connexion")
$connexion2=_FTP_Connect($connexion,$serv,$user,$pass,0,21)
;~ $reception=_FTP_FileGet($connexion2,$db,$db1)
$reception= _FTP_ProgressDownload($connexion2,$db,$db1)
$arrayftp=_Ftp_ListToArray($connexion2,2)
SplashOff ()
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUIListBox.au3>
$Form2 = GUICreate("Identification", 331, 189, -1, -1)
$PasswordEdit = GUICtrlCreateInput("password", 40, 112, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$ButtonOk = GUICtrlCreateButton("&valider", 126, 144, 75, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Sortir", 207, 144, 75, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Identifiez vous ", 40, 28, 75, 17)
$utilisateur = GUICtrlCreateInput("utilisateur", 40, 64, 225, 21)
$Label1 = GUICtrlCreateLabel("nom dutilisateur ", 40, 48, 80, 17)
$Label2 = GUICtrlCreateLabel("mot de passe", 40, 88, 75, 17)
;~ deuxieme gui
$form1 = GUICreate("accueil", 237, 336, 192, 124)
$Label1 = GUICtrlCreateLabel("Selectionnez votre projet : ", 16, 24, 130, 17)
$list1 = GUICtrlCreateListView("p",16, 56, 185, 137)
$Label2 = GUICtrlCreateLabel("creer votre projet ", 24, 224, 87, 17)
$suivant = GUICtrlCreateButton("suivant", 136, 200, 75, 25, $WS_GROUP)
$input1 = GUICtrlCreateInput("nouveau", 16, 256, 121, 21)
$Label3 = GUICtrlCreateLabel(".html", 136, 256, 50, 17)
$creer = GUICtrlCreateButton("creer", 136, 288, 75, 25, $WS_GROUP)
;~ 3eme gui
GUISetState(@SW_SHOW, $form2)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $ButtonOk
$lecture = GUICtrlRead($utilisateur)
$doss=_FTP_DirSetCurrent($connexion2,"public_html/"&$lecture)
$aFile=_Ftp_ListToArray($connexion2,2)
for $i=1 to $afile[0]
$ite=GUICtrlCreateListViewItem($aFile[$i],$List1)
Next
$mdp = GUICtrlRead($PasswordEdit)
$id=IniRead("c:\db.ini",$lecture,"mdp","faux")
if $id=$mdp then
msgbox(0,"authentification","connexion reussi")
GUIDelete($form2)
GUISetState(@SW_SHOW,$form1)
Else
msgbox(0,"authentification","authentification echoué")
EndIf
case $ButtonCancel
Exit
case $creer
$lecture2=GUICtrlRead($input1)
_FileCreate($lecture2&".html")
guidelete($form1)
case $suivant
$choix=GUICtrlRead(guictrlread($list1))
$2="/"&$choix
ConsoleWrite($choix)
MsgBox(0,"",$choix)
$reception2=_FTP_ProgressDownload($connexion2,$2,$choix)
GUIDelete($form1)
endswitch
wend