Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

VB.NET Examples

ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
FileAccess
Firebase
GMail REST API
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Sheets
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)

Java KeyStore (JKS)
Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
Upload
VoiceBase
Walmart
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(VB.NET) Get a Piece of Information from the LastErrorXml

Demonstrates how to get a bit of information from the LastErrorXml. Suppose you call ftp.DeleteRemoteFile and it fails, and the LastErrorXml property contains the XML as shown below. This example gets the content in the "statusCode" tag.

<ChilkatLog>
  <DeleteRemoteFile>
    <DllDate>Dec 30 2015</DllDate>
    <ChilkatVersion>9.5.0.55</ChilkatVersion>
    <UnlockPrefix>xxx</UnlockPrefix>
    <Username>CHILKAT:Matt</Username>
    <Architecture>Little Endian; 32-bit</Architecture>
    <Language>Visual C++ 11.0 (32-bit)</Language>
    <VerboseLogging>0</VerboseLogging>
    <filename>[does_not_exist.txt]</filename>
    <deleteFile>
      <simplePathCommand>
        <simpleCommand>
          <sendCommand>
            <sendingCommand>DELE does_not_exist.txt</sendingCommand>
          </sendCommand>
          <readCommandResponse>
            <replyLineQP>550 Delete operation failed.</replyLineQP>
          </readCommandResponse>
        </simpleCommand>
        <error>Simple path command failed.</error>
        <statusCode>550</statusCode>
        <reply>550 Delete operation failed.</reply>
      </simplePathCommand>
    </deleteFile>
    <error>Failed.</error>
  </DeleteRemoteFile>
</ChilkatLog>

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for .NET Core

Chilkat for Mono

Dim ftp As New Chilkat.Ftp2

Dim success As Boolean

'  Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")
If (success <> True) Then
    Console.WriteLine(ftp.LastErrorText)
    Exit Sub
End If


ftp.Hostname = "ftp.***.com"
ftp.Username = "***"
ftp.Password = "***"

'  Connect and login to the FTP server.
success = ftp.Connect()
If (success <> True) Then
    Console.WriteLine(ftp.LastErrorText)
    Exit Sub
End If


'  Set the current remote directory to where the file is located:
success = ftp.DeleteRemoteFile("does_not_exist.txt")
If (success <> True) Then
    Dim xml As New Chilkat.Xml
    success = xml.LoadXml(ftp.LastErrorXml)
    success = xml.SearchForTag2(Nothing,"statusCode")
    If (success = True) Then
        Console.WriteLine("statusCode = " & xml.Content)
    End If

    Exit Sub
End If



success = ftp.Disconnect()

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.