-
July 8th, 2002, 09:26 AM
#1
Open Source FTP Control
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:
regsvr32 <path_to_OCX>\FTPx.OCX
Usage
To use this object in the Windows Script Host save the following code as a .vbs file and run it using the cscript executable.
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
If you enjoyed this you might enjoy these others :
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$
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
July 8th, 2002, 09:28 AM
#2
The Control
This is the FTPx Control. You can use this control in VB, ASP, JavaScript, Delphi, VC++, the windows script host or any programming language that supports ActiveX objects. That may include PHP, but I couldn't confirm that.
If anyone knows I'd be interested.
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
July 8th, 2002, 09:30 AM
#3
The Source Code
This is the source code for the FTPx control. The code has been written in VB6.
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
July 8th, 2002, 03:34 PM
#4
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
July 8th, 2002, 07:23 PM
#5
Where were you when i needed you? j/k a year and a half ago i was looking everywhere for this, couldn't find it and wound up using my own resources, learned allot that way, but I'm storing this for future reference.
Thanks
Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”
-
July 9th, 2002, 07:25 PM
#6
T€ÐØß1 > Sorry I didn't write it sooner - hope it comes in useful Thanks!
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
-
July 11th, 2002, 06:19 PM
#7
To the person who gave me negs and the comment:
Life is all about selling - you'll come to appreciate this as you grow up. But in this instance I am giving away code that I have written in the hope that some other members of AO will find it useful. So in this context the charge is wholly unjustified and you, sir, are an arse.
If this counts as overselling myself, or if you did not find this code useful, I apologise, but I didn't sit down and think "what can I post on AO?" - I wrote the code for myself and then decided it might be useful to other AO members.
\"I may not agree with what you say, but I will defend to the death your right to say it.\"
Sir Winston Churchill.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|