Overview
I wanted to create an FTP control that would perform file uploads from VB, Delphi, VC++ or the windows script host (largely on the basis that I am too mean to buy one :)). And because I'm writing it at the weekend it's open source - so now you don't have to buy one either :) The control has been written in VB6.
I'm not going to go into a huge discussion of the source code of the control here, but it's attached below in the sourcefile.zip file if anyone wants to look. This mini-tutorial is just going to cover the registration and usage of the FTPx control (in the case of the example here for the WSH) that is included in the attached FTPx.zip file.
Registration of the control
To register the OCX component run the following command:
UsageQuote:
regsvr32 <path_to_OCX>\FTPx.OCX
To use this object in the Windows Script Host save the following code as a .vbs file and run it using the cscript executable.
If you enjoyed this you might enjoy these others ;):Code:Set FTPx =WScript.CreateObject("FTPxControl.FTPx")
FTPx.Port = 21 'Port to connect to
FTPx.Server = "127.0.0.1" 'IP address to connect to
FTPx.Proxy = "" 'IP of proxy server (if used)
FTPx.UserName = "username" 'Connection Username
FTPx.Password = "password" 'Connection Password
wscript.echo "connecting to FTP..."
If FTPx.LogOn = True Then 'Returns True if connected
wscript.echo "connected!"
'Set Remote Directory
FTPx.RCD("/some_folder/")
'Upload a file
FTPx.UploadFile ("File_to_upload.txt")
FTPx.LogOff
End If
Web based classes
Backing up the IIS metabase.
Building your own IDS tripwire.
Credit card security
Dumping SQL data to a text file
Hunting down skript kiddies
Search Engine submission 'exploit'
Forced shutdown of a remote nt/2k server
Securing an installation of IIS 4. (No, seriously)
Remote DSN Connections, using WinAPIs and the registry
Scripting Internet Connections Under Window$