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 ...
随机推荐
- spring boot(12)-数据源配置原理
本篇讲的不仅是数据源配置,这也是spring boot实现自动配置的一部分.要理解数据源的配置原理,首先要理解第十篇tomcat连接池的配置 数据源配置源码 这里截取org.springframewo ...
- gitlab 灾备
Gitlab创建备份 使用Gitlab一键安装包安装Gitlab非常简单,同样的备份恢复与迁移也非常简单.使用一条命令即可创建完整的Gitlab备份: gitlab-rake gitlab:ba ...
- javascript event visualize
很多时候拿到一个spa,特别是基于jquery的比较复杂的spa时,如果你好奇他是如何工作的,往往没有头绪. 由于spa基本上都是基于事件触发的,一个可行的办法是通过查看事件处理代码能够对spa有一个 ...
- 在虚拟机里安装linux(centos 6.5)系统
菜鸟一枚,也是接触linux系统没多长时间,前一阵子网上说有一个高级数据库工程师,因为rm -rf / 命令干掉了数据库-(nb),居然还跑路了!厉害了我的哥!也是闲的我蛋疼,在虚拟机里试了一批,本来 ...
- Linux 系统级别优化_【all】
Linux 系统优化 1.Linux系统关闭SELinux 2.Linux系统开机到登录之前启动流程 3.Linux系统设置运行级别 4.Linux系统重要的开机自启动的服务 5.Linux查看系统当 ...
- Linux echo命令详解
echo :输出文字到控制台 -n: 不换行输出 -e:解析转移字符 (-b: 退格 -n 换行 -t 空格) 常用的命令展示 echo {1..4} ==> seq -s " ...
- Alpha 冲刺报告(9/10)
Alpha 冲刺报告(9/10) 队名:洛基小队 峻雄(组长) 已完成:角色属性功能的测试版 明日计划:准备α版本的ppt 剩余任务:尽量完成角色属性功能 困难:缺乏编程经验,很难自己独立完成编写,只 ...
- SQLServer------查询结果为空的列赋默认值
ISNULL(字段,默认值) 如:SELECT ISNULL(name,'无名') FROM [User]
- 【原创】Apache ab出现 apr_pollset_poll: The timeout specified has expired 错误
使用如下参数可避免 -s timeout Seconds to max. wait for each response Default is 30 seconds -k Use HTTP KeepAl ...
- nodejs11安装教程(升级最新版本)
nodejs需要不断升级,那么电脑如何安装nodejs11呢,下面将通过亲身实践来详细介绍 工具/原料 电脑 nodejs11安装包 方法/步骤 访问node11官网,下载安装包,如下 ...