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 ...
随机推荐
- STL标签与EL表达式之间的微妙关系
很高兴,今天能和大家分享刚学的一些新知识.我们在java开发过程中经常会在jsp中嵌入一些java代码,比如<%=request.getParameter("id")%> ...
- Mysql5.7 的错误日志中最常见的note级别日志解释
在使用mysql5.7的时候,发现了不少在mysql5.6上不曾见过的日志,级别为note, 最常见的note日志以下三种,下面我们来逐个解释. 第一种,Aborted connectio ...
- swift版的GCD封装
swift版的GCD封装 说明 本人针对swift封装了GCD,包括GCDQueue,GCDGroup,GCDTimer以及GCDSemaphore,使用较为便利. 源码 https://github ...
- Linux 系统常见命令功能大全_【all】
Linux常见快捷键(6个) ctrl + u:剪贴光标前面 ctrl + k:剪贴光标后面 ctrl + y:粘贴 ctrl + r:查找命令 ctrl + insert:复制 shift+ ins ...
- Skype for Business Server-呼叫质量仪表板(一)安装与配置
第一篇:安装与配置 很多公司在运行过程中都遇到了难以追踪客服人员绩效的情况,公司没有有效的方法追踪员工在通过电话等远程方式解决客户问题.销售产品.客户关怀的情况.Skype for Business提 ...
- Numpy 的常用操作
1.创建数组array # 创建数组array import numpy as np a = np.array([1,2,3]) #创建数组 b = np.array([(1.5,2,3), (4,5 ...
- 张高兴的 Windows 10 IoT 开发笔记:使用 MAX7219 驱动数码管
This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#. GitHub:https://github.co ...
- PHP设计模式系列 - 中介者模式
中介者模式 中介者模式用于开发一个对象,这个对象能够在类似对象相互之间不直接相互的情况下传送或者调解对这些对象的集合的修改.一般处理具有类似属性,需要保持同步的非耦合对象时,最佳的做法就是中介者模式. ...
- JDK/bin目录下的不同exe文件的用途
新安装完JDk 大家是否发现安装目录的bin文件夹有很多exe文件 下面就为大家讲解不同exe文件的用途 javac:Java编译器,将Java源代码换成字节代 java:Java解释器,直接从类文件 ...
- HTML5 canvas画图
HTML5 canvas画图 HTML5 <canvas> 标签用于绘制图像(通过脚本,通常是 JavaScript).不过,<canvas> 元素本身并没有绘制能力(它仅仅是 ...