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. sun.misc.BASE64Encoder在Eclipse中不能直接使用的原因和解决方案

    1.为什么在Eclipse中不能直接使用sun.misc.BASE64Encoder和sun.misc.BASE64Decoder呢? 因为sun.misc.BASE64Encoder和sun.mis ...

  2. 机器学习中正则惩罚项L0/L1/L2范数详解

    https://blog.csdn.net/zouxy09/article/details/24971995 原文转自csdn博客,写的非常好. L0: 非零的个数 L1: 参数绝对值的和 L2:参数 ...

  3. jetty8 中的异常 There is an error in invoking javac. A full JDK (not just JRE) is required...

    在jetty文件夹下的start.ini文件里有这么一行"-Dorg.apache.jasper.compiler.disablejsr199=true"注释,把这个注释去掉,再启 ...

  4. datediff

    DateDiff()是计算机函数. 中文名 日期比较函数 外文名 DateDiff() 作    用 得 出两个日期之间的间隔 用    途 返回两个日期之间的差值 允许数据类型 timeinterv ...

  5. c# Windows Service 桌面上显示UI

    介绍 本文的目的是说明如何从Windows Vista中的服务正确启动交互式进程,以及演示如何以完全管理员权限启动该进程.交互式过程是能够在桌面上显示UI的过程. 本文介绍如何创建一个名为Loader ...

  6. TreeSet集合的add()方法源码解析(01.Integer自然排序)

    >TreeSet集合使用实例 >TreeSet集合的红黑树 存储与取出(图) >TreeSet的add()方法源码     TreeSet集合使用实例 package cn.itca ...

  7. 【Excel】如何用SUMIF实现SUMIFS的功能

    如何用SUMIF实现SUMIFS的功能   添加辅助列,辅助列内容为"条件区域1内容+条件区域内容2" 举个例子,我要挑选出"二车间"的"过桥过路费& ...

  8. Linux--面试题-01

    1. 在Linux系统中,以 文件 方式访问设备 . 2. Linux内核引导时,从文件 /etc/fstab 中读取要加载的文件系统. 3. Linux文件系统中每个文件用 i节点 来标识. 4. ...

  9. javascript花式理解闭包

    一.变量的作用域 要理解闭包,首先必须理解Javascript特殊的变量作用域. 变量的作用域无非就是两种:全局变量和局部变量. Javascript语言的特殊之处,就在于函数内部可以直接读取全局变量 ...

  10. lvm xfs 扩容

    lvresize -L 300M /dev/vg1/lv1 #重新设定大小 e2fsck -f /dev/vg1/lv1 #检查磁盘错误 (针对ext4执行) resize2fs /dev/vg1/l ...