
Walkabout
Active Members-
Posts
37 -
Joined
-
Last visited
Walkabout's Achievements

Seeker (1/7)
0
Reputation
-
FYI This UDF no longer seems to work with the latest beta 3.2.10. Walkabout
-
Hi All, I needed a procedure to recursively get the contents of a remote directly, so here it is: ;=============================================================================== ; ; Function Name: _FTPGetFoldercontents ; Description: Recursively retrieves the contents of a directory on an FTP server. ; Parameter(s): $s_Server - Server name/ip. ; $s_Username - Username. ; $s_Password - Password. ; $s_RemoteDir - The directory on the server to retrieve. End in "/" ; $s_LocalDir - The Local directory to save to ; Requirement(s): DllCall, wininet.dll ; Return Value(s): On Success - None. Byref variable $i_Count returns number of files (not ; including directories) transferred. ; On Failure - None, exits with Msg. Opportunity here for some improvement ; Author(s): Walkabout 2006-10-18 ; ;=============================================================================== Func _FTPGetFolderContents($s_Server, $s_UserName, $s_Password, $s_RemoteDir, $s_LocalDir, ByRef $i_Count) Local $h_Handle Local $DllRect Local $FileInfo[12] Local $Open Local $Conn Local $s_Filename ;Open the Connection. This has to be done for each new level of recusion. $Open = _FTPOpen ('MyFTP Control') If @error Then Failed ("Open") $Conn = _FTPConnect ($Open, $s_Server, $s_UserName, $s_Password, 1) If @error Then Failed ("Connect") ;First File If Not FileExists($s_LocalDir) Then DirCreate($s_LocalDir) $FileInfo = _FtpFileFindFirst ($Conn, $s_RemoteDir & '*.*', $h_Handle, $DllRect) $error = @error If Not $FileInfo[0] Then Return $s_Filename = $FileInfo[10] ConsoleWrite($i_Count & " - " & $s_RemoteDir & $s_Filename & @LF) If $FileInfo[1] = 16 Then;Directory. Recurse down one level If $s_Filename <> "." And $s_Filename <> ".." Then If Not FileExists($s_LocalDir & $s_Filename & "\") Then DirCreate($s_LocalDir & $s_Filename & "\") _FTPGetFolderContents($s_Server, $s_UserName, $s_Password, $s_RemoteDir & $s_Filename & "/", $s_LocalDir & $s_Filename & "\", $i_Count) EndIf Else; File. Retrieve it $Result = _FTPGetFile ($Conn, $s_RemoteDir & $s_Filename, $s_LocalDir & $s_Filename) $i_Count += 1 EndIf ;Subsequent Files While 1 $FileInfo = _FtpFileFindNext ($h_Handle, $DllRect) If Not $FileInfo[0] Then Return $s_Filename = $FileInfo[10] ConsoleWrite($i_Count & " - " & $s_RemoteDir & $s_Filename & @LF) If $FileInfo[1] = 16 Then;Directory. Recurse down one level If $s_Filename <> "." And $s_Filename <> ".." Then If Not FileExists($s_LocalDir & $s_Filename & "\") Then DirCreate($s_LocalDir & $s_Filename & "\") _FTPGetFolderContents($s_Server, $s_UserName, $s_Password, $s_RemoteDir & $s_Filename & "/", $s_LocalDir & $s_Filename & "\", $i_Count) EndIf Else; File. Retrieve it $Result = _FTPGetFile ($Conn, $s_RemoteDir & $s_Filename, $s_LocalDir & $s_Filename) $i_Count += 1 EndIf WEnd EndFunc ;==>_FTPGetFolderContents and an example #include <ftp.au3> $server = 'ftp.myserver.com' $username = 'ftpuser' $pass = 'password' Local $RemoteDir = '/wwwroot/' Local $LocalDir = "C:\TempDir\" Local $Count = 0 _FTPGetFolderContents($Server, $UserName, $Pass, $RemoteDir, $LocalDir,$Count) msgbox(0,"Complete",$Count & " Records Processed") I played around with the code a little, tidying it up before posting. As I can't test that my changes haven't broken it, let me know if you spot any issues. Walkabout
-
Autoit can use for Outlook Plugin?
Walkabout replied to srinivas224's topic in AutoIt General Help and Support
I'm not sure if this is what you are looking for, but check AutoIt for the Masses in my Sig. Walkabout. -
Galenda - a calendar application in AutoIt
Walkabout replied to peethebee's topic in AutoIt Example Scripts
If you are using an exe I'm assuming you want to do one of two things. 1) Encrypt the database file. This could only be done safely when the database was not in use, either by: i) Decrypting at startup and then encrypting at close. This would leave the database file unencrypted the whole time the application was running, which would almost be pointless from a security perspective. Especially as calendar applications tend to remain open most of the time. ii) Decrypting every time you wish to access the database and then re-encrypting when finished would slow down response times and be very inefficient. 2) Encrypt the data via a temporary text file and then feeding that in to an unencrypted database file. Sounds painful and unlikely to be faster than using a UDF. If you use a DLL to encrypt data on the fly, then you are really only encrypting text, and therefore a UDF would do. There doesn't seem to be many free open-source encryption DLLs out there anyway. Are you sure that an exe/dll is the right way to go? Why don't you use one of the many good UDFs here on the forum and then save the encrypted text into an unencrypted database file? Walkabout. -
Galenda - a calendar application in AutoIt
Walkabout replied to peethebee's topic in AutoIt Example Scripts
Does that mean you might want to encrypt binary data. If so, and if you don't mind me asking, what binary data would a calendar application want to encrypt? I'll have a troll through the forum to see if I can track down a good encryption UDF. Walkabout. -
Galenda - a calendar application in AutoIt
Walkabout replied to peethebee's topic in AutoIt Example Scripts
I had a bit of a poke around, and options which immediately sprung to mind were crosscrypt, truecrypt and gpg. The first two are more about mounting virtual drives which use encrypted files to store their data, so they are probably not ideal. GPG is a strong possiblity. It is GPL, and proven, but the exe is about 850k. Is this too large? I'm also wondering what you want it for. Could a DLL do? How strong do you want the encryption? Would something simpler do (eg ROT13) or does it need to be encrypted? Do we want open source, or would closed source freeware do? Just let me know and I'll try to help. Walkabout -
Galenda - a calendar application in AutoIt
Walkabout replied to peethebee's topic in AutoIt Example Scripts
peethebee, This is fantastic. I've been wanting to write my own PIM, but wasn't sure how to do the display. I'd like to help, but I haven't spoken any German in about twenty years, and even then it was non-technical. I'm not sure how it could be done, but if we could work out a way to get both english and german discussions going, it could help things along. It would be cool to have the UI based on language files too, so that it's international. Walkabout -
Have the integrity to honetly say who you are in your eMails. Anything else is phishing or spamming! It's things like this that give the rest of the AutoIt community a bad name. Walkabout
-
Interfacing With Java Windows
Walkabout replied to esfalk's topic in AutoIt General Help and Support
Bump -
Script for all database connections...
Walkabout replied to Raestlin's topic in AutoIt Example Scripts
Thanks Ptrex. You've made me a very happy scripter!!!!! Walkabout -
Interfacing With Java Windows
Walkabout replied to esfalk's topic in AutoIt General Help and Support
We looked at some automated testing solutions for work a little while ago, and being an AutoIt user, I asked the question about Java Controls. The answer was that with a special plugin, Quicktest Pro by Mercury (Used to be called WinRunner) is able to interact with Java controls. Anyone got any insights on how they might do it and if the technique could be ported to AutoIt? Brief reference here Ta Walkabout -
Script for all database connections...
Walkabout replied to Raestlin's topic in AutoIt Example Scripts
Fantastic Post Raestlin. I've been struggling with trying to connect to an AS400 database without resorting to ODBC for a long time now, and had no success. How did you determine what the DSN connect strings should be, and maybe I can add another one? Thanks Walkabout -
jpm, I noticed that the new error codes were missing from the documentation for _INetSMTPMail, so here's the updated help for the next release. Let me know if this should have been posted somewhere else. Regards Walkabout INetSMTPMail.txt
-
Internet Explorer Automation UDF library
Walkabout replied to DaleHohm's topic in AutoIt Example Scripts
Hi All, Thanks for such a useful UDF. I've been using it extensively recently and found it to be very helpful. A quick question if I may? When accessing many web pages, has anyone come across a problem with IE consuming more and more available memory until the system grinds to a halt? I think this is an IE problem, but I'm wondering if anyone has any ideas on how to 'band-aid' it using UDF. Thanks Walkabout -
code of sending Email through Telnet
Walkabout replied to Clever1mba's topic in AutoIt Example Scripts
Firestorm, At this stage you can't. Walkabout