//go to Project->Components->Select 'Microsoft Internet Transfer Controls 6.0(sp4)' and - 'Microsoft Internet Control'
//Drag Inet and webbrowser control
//Open FTP
WebBrowser1.Navigate "ftp://rpc:rpc123@sdmftp.com"
//where rpc and rpc123 are username and password
//UPLOAD to FTP
Inet1.Execute "ftp://rpc:rpc123@sdmftp.com", "put c:\npoh2010.zip npoh2010.zip "
Do While Inet1.StillExecuting: DoEvents: Loop
MsgBox "uploading Complete", vbInformation
//DOWNLOAD from FTP
Inet1.Execute "ftp://rpc:rpc123@sdmftp.com", "get dev.zip c:\dev.zip"
Do While Inet1.StillExecuting: DoEvents: Loop
MsgBox "Downloading Complete", vbInformation
//Open FTP with Shell Command
//declare this function
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
//open by default browser
ShellExecute 0, "open", "ftp://rpc:rpc123@sdmftp.com", vbNullString, vbNullString, 1
//open by selected browser
ShellExecute 0, "open", "C:\Program Files\opera\opera.exe", "ftp://rpc:rpc123@sdmftp.com", vbNullString, 1
No comments:
Post a Comment