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的更多相关文章

  1. delphi使用Chilkat 组件和库从SFTP下载文件

    官网地址:https://www.example-code.com/delphiDll/default.asp 实例代码:(不包括全局解锁)  密码生成器:https://www.cnblogs.co ...

  2. DIY FSK RFID Reader

    This page describes the construction of an RFID reader using only an Arduino (Nano 3.0 was tested, b ...

  3. RFID 读写器 Reader Writer Cloner

    RFID读写器的工作原理 RFID的数据采集以读写器为主导,RFID读写器是一种通过无线通信,实现对标签识别和内存数据的读出和写入操作的装置. 读写器又称为阅读器或读头(Reader).查询器(Int ...

  4. RFID Reader 线路图收集

    This 125 kHz RFID reader http://www.serasidis.gr/circuits/RFID_reader/125kHz_RFID_reader.htm http:// ...

  5. 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 ...

  6. javaWEB总结(12):JSP页面的九个隐含对象

    前言 jsp本质上是一个servlet,而在jsp中有九个不用声明就可以使用的对象,我们叫他隐含对象.本文基于上文所写,如有需要可查看上一篇文章javaWEB总结(11):JSP简介及原理. 打开上次 ...

  7. Angular4+路由

    路由的作用就是(导航):会加载与请求路由相关联的组件,并获取特定路由的相关数据,这允许我们通过控制不同的路由,获取不同的数据,从而渲染不同的页面: 几种常见的路由配置: Angular路由器是一个可选 ...

  8. Peer-to-Peer (P2P) communication across middleboxes

    Internet Draft                                                   B. FordDocument: draft-ford-midcom- ...

  9. (Delphi) Using the Disk Cache 使用磁盘缓存

    The Chilkat Spider component has disk caching capabilities. To setup a disk cache, create a new dire ...

随机推荐

  1. mongodb存储引擎

    存储引擎(Storage Engine)是MongoDB的核心组件,负责管理数据如何存储在硬盘(Disk)和内存(Memory)上.从MongoDB 3.2 版本开始,MongoDB 支持多数据存储引 ...

  2. Sqlserver2014 迁移数据库

    由于当初安装sqlserver 的时候选择默认安装的路径,导致现在c盘爆满,安装不了其它软件.因此想到了迁移数据库,网上搜索了一些简介,但是缺少一些步骤,导致数据库附加的时候失败.现总结如下: 1.将 ...

  3. C++ 的继承与虚函数 读书笔记

    一.类与类之间关系: 1.类与类之间可能会存在共性. 2.类与类之间必定会有差异. 3.为也节约开发时间和代码量,我们在设计类时可以把类的共享抽象出来形成一个基础类(基类). 4.使用基类+差异生成一 ...

  4. mysql性能优化-慢查询分析、优化索引和配置 (慢查询日志,explain,profile)

    mysql性能优化-慢查询分析.优化索引和配置 (慢查询日志,explain,profile) 一.优化概述 二.查询与索引优化分析 1性能瓶颈定位 Show命令 慢查询日志 explain分析查询 ...

  5. form插件ajaxForm和ajaxSubmit方法传递对象参数说明

    form插件的ajaxForm和ajaxSubmit方法的Options对象还可以用来将值传递给jQuery的$.ajax方法.如果你熟悉$.ajax所支持的options,你可以利用它们来将Opti ...

  6. Nav 切换

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  7. Hadoop HBase概念学习系列之HBase里的4维坐标系统(第一步定位行键 -> 第二步定位列簇 -> 第三步定位列修饰符 -> 第四步定位时间戳)(十八)

    HBase里的4维坐标系统(第一步定位行键   ->   第二步定位列簇  ->  第三步定位列修饰符   ->  第四步定位时间戳) HBase里的4维坐标系统(第一步定位行键   ...

  8. JS传递函数并且调用

    封装的函数: function getDataByJsonP(methName, inData, fn) { // 这里fn可以直接传入函数名字 $.ajax({ url: '', //请求的url地 ...

  9. 51 nod 1682 中位数计数

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1682 1682 中位数计数 基准时间限制:1 秒 空间限制: ...

  10. Golang 临时对象池 sync.Pool

    Go 1.3 的sync包中加入一个新特性:Pool.官方文档可以看这里http://golang.org/pkg/sync/#Pool 这个类设计的目的是用来保存和复用临时对象,以减少内存分配,降低 ...