tcb Posted June 17, 2010 Share Posted June 17, 2010 I am trying to get autoit to pull a series of files from a webserver. I have a script which prompts the user for their userid and password, captures those pieces of information and then subsequently uses that information for the rest of the script. I now want to update the script to get the userid and password from a csv file. Could anyone point me in the right direction? the initial script is below $SXUSERNAME = InputBox(4, "User name", "please enter your username including domain") $SXPASSWORD = InputBox(4, "Password", "please enter your password") Global $SVRLOCATION = String("http://192.168.65.123/api/dav/Calendars/Users/") Global $SXUN = $SXUSERNAME Global $CAL = String("/Calendar") Global $WGET = String("C:\PF\GnuWin32\bin\wget --http-user=") Global $HTTPP = String(" --http-password=") Global $A1 = String(" \ --secure-protocol=auto --no-check-certificate --recursive \ --no-directories -P ") Global $FEXLOC = String("c:\calendars\NEWTEST\"&$SXUSERNAME) Global $L1 = String(" --level=1 \ ") Dim $URL = $SVRLOCATION&$SXUN&$CAL Dim $sCDOS1 = $WGET&$SXUSERNAME&$HTTPP&$SXPASSWORD&$A1&$FEXLOC&$L1&$URL MsgBox(0,"TEST",$URL) MsgBox(0,"WGET",$sCDOS1) ClipPut($sCDOS1) #include <Process.au3> $rc = _RunDOS ( $sCDOS1 ) This script as is works fine but I want to add the extra layer as described on top. I guess I will need a loop to work though the csv as well. Thanks Tony Link to comment Share on other sites More sharing options...
Juvigy Posted June 17, 2010 Share Posted June 17, 2010 Check out the INI functions in the help file. Also you may want to encrypt the user and pass in the INI file with the encryption functions available. Link to comment Share on other sites More sharing options...
tcb Posted June 17, 2010 Author Share Posted June 17, 2010 thanks but I am not sure how ini helps. would I have to generate the ini file with unique keys in username and password sections so something like username section key = username 1 key = username 2 password section key = userpass 1 key = userpass 2 thanks Link to comment Share on other sites More sharing options...
Juvigy Posted June 17, 2010 Share Posted June 17, 2010 Yes , you can even generate it using IniWriteSection and IniWrite. Of course having more then 100 users would make using csv file and ADODB connection more suitable. Link to comment Share on other sites More sharing options...
tcb Posted June 17, 2010 Author Share Posted June 17, 2010 thanks once again. more than likely to ultimately have more than 100 users.... Link to comment Share on other sites More sharing options...
jchd Posted June 17, 2010 Share Posted June 17, 2010 You can buy yourself a bit more "security" by storing the hash of user & password & salt instead of storing actual data yourself. Then if you have a significant number of users in the near future, use an encrypted SQLite database. All embedded, up to date and no need to rely on third-party software being installed (or having to install it). This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
tcb Posted June 17, 2010 Author Share Posted June 17, 2010 i should explain that at this stage security is not a concern. the script will be run as an admin. the admin will be required to build the csv with username/password. ultimate goal is to have script read username/password from file, use those details to perform wget against server, then continue to next name in list until end. 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