SFTP Using Chilkat Active component
https://www.example-code.com/vb6/sftp_uploadBandwidthThrottle.asp
Private Sub Command1_Click()
' Important: It is helpful to send the contents of the
' sftp.LastErrorText property when requesting support.
' Dim sftp As New ChilkatSFtp
' Any string automatically begins a fully-functional 30-day trial.
Dim success As Long
success = sftp.UnlockComponent("Anything for 30-day trial")
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
' Set some timeouts, in milliseconds:
sftp.ConnectTimeoutMs = 15000
sftp.IdleTimeoutMs = 15000
' Connect to the SSH server.
' The standard SSH port = 22
' The hostname may be a hostname or IP address.
Dim port As Long
Dim hostname As String
'hostname = "www.my-ssh-server.com"
hostname = "127.0.0.1"
port = 22
success = sftp.Connect(hostname, port)
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
' Authenticate with the SSH server. Chilkat SFTP supports
' both password-based authenication as well as public-key
' authentication. This example uses password authenication.
'success = sftp.AuthenticatePw("myLogin", "myPassword")
success = sftp.AuthenticatePw("wgscd1", "111111")
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
' After authenticating, the SFTP subsystem must be initialized:
success = sftp.InitializeSftp()
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
' Limit the transfer rate (bandwidth throttle) to 64K per second.
sftp.BandwidthThrottleUp = 65536
' Upload from the local file to the SSH server.
' Important -- the remote filepath is the 1st argument,
' the local filepath is the 2nd argument;
Dim remoteFilePath As String
remoteFilePath = "hamlet.xml"
Dim localFilePath As String
localFilePath = "c:/temp/hamlet.xml"
success = sftp.UploadFileByName(remoteFilePath, localFilePath)
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
Text1.Text = Text1.Text & "Success." & vbCrLf
success = sftp.DownloadFileByName("TrackMM5--.exe", "c:/temp/TrackMM5--.exe")
If (success <> 1) Then
Text1.Text = Text1.Text & sftp.LastErrorText & vbCrLf
Exit Sub
End If
Text1.Text = Text1.Text & "Download File Success." & vbCrLf
End Sub
Private Sub sftp_PercentDone(ByVal percent As Long, abort As Long)
Caption = Caption & "," & percent
End Sub
SFTP Using Chilkat Active component的更多相关文章
- delphi使用Chilkat 组件和库从SFTP下载文件
官网地址:https://www.example-code.com/delphiDll/default.asp 实例代码:(不包括全局解锁) 密码生成器:https://www.cnblogs.co ...
- DIY FSK RFID Reader
This page describes the construction of an RFID reader using only an Arduino (Nano 3.0 was tested, b ...
- RFID 读写器 Reader Writer Cloner
RFID读写器的工作原理 RFID的数据采集以读写器为主导,RFID读写器是一种通过无线通信,实现对标签识别和内存数据的读出和写入操作的装置. 读写器又称为阅读器或读头(Reader).查询器(Int ...
- RFID Reader 线路图收集
This 125 kHz RFID reader http://www.serasidis.gr/circuits/RFID_reader/125kHz_RFID_reader.htm http:// ...
- RFIDler - An open source Software Defined RFID Reader/Writer/Emulator
https://www.kickstarter.com/projects/1708444109/rfidler-a-software-defined-rfid-reader-writer-emul h ...
- javaWEB总结(12):JSP页面的九个隐含对象
前言 jsp本质上是一个servlet,而在jsp中有九个不用声明就可以使用的对象,我们叫他隐含对象.本文基于上文所写,如有需要可查看上一篇文章javaWEB总结(11):JSP简介及原理. 打开上次 ...
- Angular4+路由
路由的作用就是(导航):会加载与请求路由相关联的组件,并获取特定路由的相关数据,这允许我们通过控制不同的路由,获取不同的数据,从而渲染不同的页面: 几种常见的路由配置: Angular路由器是一个可选 ...
- Peer-to-Peer (P2P) communication across middleboxes
Internet Draft B. FordDocument: draft-ford-midcom- ...
- (Delphi) Using the Disk Cache 使用磁盘缓存
The Chilkat Spider component has disk caching capabilities. To setup a disk cache, create a new dire ...
随机推荐
- iptable防火墙案例
[root@WX020 firewall]# cat /etc/sysconfig/iptables# Firewall configuration written by system-config- ...
- 通过代码管理工具 git 完成一次完整的代码管理过程
1.从公共远程fork一份自己的本地远程之后,从本地远程 clone 到本地 2.将本地代码跟公共远程代码做关联配置 git remote add upstream https://github.co ...
- ExpressRoute 合作伙伴和对等位置
本文中的表格提供有关 ExpressRoute 连接提供商.ExpressRoute 地理覆盖范围.通过 ExpressRoute 支持的 Azure 服务以及 ExpressRoute 系统集成商 ...
- linux/OSX中“DD”命令制作ISO镜像操作系统安装U盘
linux或者OS X系统中,使用“dd”命令可以直接在终端命令行模式下,制作ISO镜像的系统安装盘. 一.linux系统以centOS7为例. sudo dd if=镜像路径 of=USB设备路径 ...
- 使用Reflector反编译并提取源代码
Reflector是一个强大的.net 反编译工具,有时我们不止需要反编译源代码,更需要提取源代码. Reflector本身不自带提取源代码功能,不过可以借助插件Reflector.FileDisas ...
- iOS8 生成二维码与条形码
iOS8 生成二维码与条形码 效果图: 源码: // // ViewController.m // CodeCreator // // Created by YouXianMing on 15/3/1 ...
- Linux env命令详解
env:查询环境变量 常用的命令展示 查看当前环境的环境变量 [root@localhost ~]# env HOSTNAME=localhost.localdomain SELINUX_ROLE_R ...
- Vue安装以及Vue项目创建以及Vue Devtools安装
这几天一直在学习Vue.js框架. 因为以前没有前端项目的经验,也没学过什么前端框架,所以,对于vue.js的学习有些不知所措. 在vue.js官网看教程,按照教程指点,可以不用脚手架开发,也可以搭建 ...
- 铁乐学python_Day42_锁和队列
铁乐学python_Day42_锁和队列 例:多个线程抢占资源的情况 from threading import Thread import time def work(): global n tem ...
- php算法基础----时间复杂度和空间复杂度
算法复杂度分为时间复杂度和空间复杂度. 其作用: 时间复杂度是指执行算法所需要的计算工作量: 而空间复杂度是指执行这个算法所需要的内存空间. (算法的复杂性体现在运行该算法时的计算机所需资源的多少上, ...