vimponia Posted December 3, 2011 Share Posted December 3, 2011 Hi, all,How can I put the variable into a ini file and read the settings rather then I use it now#include <FTPEx.au3> $server = 'site.nl' ;Server gegevens om te uploaden$username = 'user' ;Gebruikersnaam$pass = 'XXXXXXX' ;Wachtwoord$Bestand = 'ton.txt' ;Het bestand om te uploaden$Path = '/httpdocs/0/' ;De juiste directory waar het te up te loaden bestand komt te staan$Open = _FTP_Open('MyFTP Control')$Conn = _FTP_Connect($Open, $server, $username, $pass, 1) $upload = _FTP_FilePut($Conn, $Bestand, $Path&$Bestand)$Ftpc = _FTP_Close($Open)Thanks for any help in advanceT Link to comment Share on other sites More sharing options...
sleepydvdr Posted December 4, 2011 Share Posted December 4, 2011 (edited) First, create an ini file with info like this in it (note: do not put spaces around the equals sign): [FTPInfo] server='site.nl' username='user' pass='XXXXXXX' Bestand='ton.txt' Path='/httpdocs/0/' Then your script should read the information from the file like so: $dataFile = "data.ini" $server = IniRead($dataFile, "FTPInfo", "server", "Not Found") $username = IniRead($dataFile, "FTPInfo", "username", "Not Found") $pass = IniRead($dataFile, "FTPInfo", "pass", "Not Found") $Bestand = IniRead($dataFile, "FTPInfo", "Bestand", "Not Found") $Path = IniRead($dataFile, "FTPInfo", "Path", "Not Found") Then you can run your connection. Edited December 4, 2011 by sleepydvdr #include <ByteMe.au3> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now