### BeginUpload Method Example Source: https://www.chilkatsoft.com/refdoc/xojoUploadRef.html Starts an asynchronous upload. Returns True for success, False for failure. A background thread is started for the upload. ```vb.net Dim chilkatUpload As New Chilkat.Upload Dim success As Boolean ' ... (setup upload properties and add files) success = chilkatUpload.BeginUpload() If success Then ' Upload is running in the background. ' Check UploadInProgress and UploadSuccess properties later. Else Response.Write(chilkatUpload.LastErrorText & vbCrLf) End If ``` -------------------------------- ### C++ Example: Basic Compression and Encryption Source: https://www.chilkatsoft.com/refdoc/wcppCkCompressionWRef.html Demonstrates how to compress and encrypt a file using CkCompressionW. This example shows the basic setup and usage of the CompressEncryptFile method. ```cpp #include "CkCompressionW.h" #include "CkJsonObjectW.h" #include "CkTaskW.h" void CompressEncryptFileExample(const wchar_t *srcPath, const wchar_t *destPath) { CkCompressionW compression; CkJsonObjectW cryptParams; // Example: Set encryption parameters (replace with actual values) cryptParams.put_String( ``` ```cpp cryptParams.put_String("encryptionAlg", "aes"); cryptParams.put_String("key", "yourSecretKey"); cryptParams.put_Int("iv", 123456789); // Example IV // Compress and encrypt the file bool success = compression.CompressEncryptFile(cryptParams, srcPath, destPath); if (success) { // File compressed and encrypted successfully } else { // Handle error } } ``` -------------------------------- ### SCP Event Callback Setup Example Source: https://www.chilkatsoft.com/refdoc/objcCkoScpRef.html Example of setting up an event callback object for SCP operations. Your application defines a class inheriting from CkoBaseProgress to handle events. ```objective-c CkoScp *scp = [[CkoScp alloc] init]; MyScpProgress *callbackObj = [[MyScpProgress alloc] init]; [scp setEventCallbackObject:callbackObj]; ``` -------------------------------- ### Get Sub-element Attribute Source: https://www.chilkatsoft.com/refdoc/xojoRssRef.html Retrieves the value of a specified attribute from a sub-element. For example, to get the 'isPermaLink' attribute of the 'guid' sub-element, use item.GetAttr("guid","isPermaLink"). Returns Nil on failure. ```Xojo Function GetAttr(tag As String, attrName As String) As String Returns the value of a sub-element attribute. For example, to get the value of the "isPermaLink" attribute of the "guid" sub-element, call item.GetAttr("guid","isPermaLink"). Returns Nil on failure ``` -------------------------------- ### C# QuickGetBd Example Source: https://www.chilkatsoft.com/refdoc/csHttpRef.html Sends an HTTP GET request and returns the binary response body in BinData. Returns true for success, false for failure. ```csharp Chilkat.Http http = new Chilkat.Http(); Chilkat.BinData bd = new Chilkat.BinData(); // ... (unlock code) bool success = http.QuickGetBd("https://www.chilkatsoft.com", bd); if (success) { Console.WriteLine("Downloaded " + bd.NumBytes + " bytes."); } else { Console.WriteLine(http.LastErrorText); } ``` -------------------------------- ### InitializeSftp Example Source: https://www.chilkatsoft.com/refdoc/objcCkoSFtpRef.html Initializes the SFTP subsystem after connecting and authenticating. ```Objective-C BOOL success = [sftpObject InitializeSftp]; ``` -------------------------------- ### Get Sub-element Attribute Value Source: https://www.chilkatsoft.com/refdoc/rubyCkRssRef.html Retrieves the value of a sub-element's attribute. For example, to get the 'isPermaLink' attribute of the 'guid' sub-element, use item.GetAttr("guid", "isPermaLink"). Returns true on success, false on failure. ```ruby outStr = CkString.new() status = rss.GetAttr(tag, attrName, outStr) retStr = rss.getAttr(tag, attrName) ``` -------------------------------- ### GetAttr Source: https://www.chilkatsoft.com/refdoc/rubyCkRssRef.html Retrieves the value of a specified attribute from a sub-element identified by its tag. For example, it can get the 'isPermaLink' attribute of a 'guid' sub-element. ```APIDOC ## GetAttr ### Description Retrieves the value of a specified attribute from a sub-element identified by its tag. For example, it can get the 'isPermaLink' attribute of a 'guid' sub-element. ### Method GET ### Endpoint /rss/element/{tag}/attribute/{attrName} ### Parameters #### Path Parameters - **tag** (string) - Required - The tag of the sub-element. - **attrName** (string) - Required - The name of the attribute to retrieve. ### Response #### Success Response (200) - **status** (boolean) - True if the attribute was found and its value retrieved, false otherwise. - **outStr** (string) - The value of the attribute if found. #### Response Example ```json { "status": true, "outStr": "true" } ``` ``` -------------------------------- ### Basic Event Callback Setup Source: https://www.chilkatsoft.com/refdoc/wcppCkRssWRef.html Demonstrates how to set up a custom event callback object for RSS operations. ```cpp CkRssW rss; MyRssProgressW callbackObj; rss.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### StartKeyboardAuth Method Source: https://www.chilkatsoft.com/refdoc/csSshTunnelRef.html Begins keyboard-interactive authentication with the SSH server. Returns an XML string with authentication prompts. ```csharp public string StartKeyboardAuth(string login); ``` -------------------------------- ### Hash Begin String Example Source: https://www.chilkatsoft.com/refdoc/xojoCrypt2Ref.html Starts a chunked hashing operation for a string. Use HashMoreString for subsequent chunks and HashFinalENC to get the final hash. ```Xojo Function HashBeginString(strData As String) As Boolean ' Method implementation details would go here. End Function ``` -------------------------------- ### Get Last Status Text Example Source: https://www.chilkatsoft.com/refdoc/pythonCkHttpRef.html Example showing the status text 'OK' in an HTTP response. ```text HTTP/1.1 200 OK Content-Type: application/json Last-Modified: Sun, 20 Aug 2023 11:36:27 GMT Accept-Ranges: bytes ETag: "34c27f8e5ad3d91:0" Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET Date: Sat, 30 Aug 2025 14:35:55 GMT Content-Length: 22 { "hello": "world" } ``` -------------------------------- ### PowerShell QuickGetBd Example Source: https://www.chilkatsoft.com/refdoc/csHttpRef.html Sends an HTTP GET request and returns the binary response body in BinData. Returns true for success, false for failure. ```powershell $http = New-Object Chilkat.Http $bd = New-Object Chilkat.BinData # ... (unlock code) $success = $http.QuickGetBd("https://www.chilkatsoft.com", $bd) if ($success) { $bd.NumBytes } else { $http.LastErrorText } ``` -------------------------------- ### Event Callback Setup Source: https://www.chilkatsoft.com/refdoc/wcppCkPrivateKeyWRef.html Example of setting up an event callback object by inheriting from CkBaseProgressW and assigning it to the private key object. ```cpp CkPrivateKeyW privatekey; MyPrivateKeyProgressW callbackObj; privatekey.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Start Timing Source: https://www.chilkatsoft.com/refdoc/perlCkSocketRef.html Starts a timer. The ElapsedSeconds property can then be used to get the time elapsed since this method was called. ```perl $socket->StartTiming(); ``` -------------------------------- ### Get Last HTTP Response Header Example Source: https://www.chilkatsoft.com/refdoc/pythonCkHttpRef.html Example of a full response header received from an HTTP request. ```text Content-Type: application/json Last-Modified: Sun, 20 Aug 2023 11:36:27 GMT Accept-Ranges: bytes ETag: "34c27f8e5ad3d91:0" Server: Microsoft-IIS/10.0 X-Powered-By: ASP.NET Date: Sat, 30 Aug 2025 14:35:55 GMT Content-Length: 22 ``` -------------------------------- ### SFTP Event Callback Setup Example Source: https://www.chilkatsoft.com/refdoc/objcCkoSFtpRef.html Demonstrates how to set up an event callback object for SFTP operations. This allows your application to receive progress and status updates. ```Objective-C CkoSFtp *sftp = [[CkoSFtp alloc] init]; MySFtpProgress *callbackObj = [[MySFtpProgress alloc] init]; [sftp setEventCallbackObject:callbackObj]; ``` -------------------------------- ### Create CkJavaKeyStore Object Source: https://www.chilkatsoft.com/refdoc/vcCkJavaKeyStoreRef.html Demonstrates how to create an instance of the CkJavaKeyStore class, either on the stack or dynamically. ```cpp // Local variable on the stack CkJavaKeyStore obj; // Dynamically allocate/delete CkJavaKeyStore *pObj = new CkJavaKeyStore(); // ... delete pObj; ``` -------------------------------- ### Get and Set ClientIdentifier Property Source: https://www.chilkatsoft.com/refdoc/tclSFtpRef.html Sets or gets the client-identifier string used during SSH/SFTP connection. The default value starts with 'SSH-2.0-Chilkat_'. ```Tcl # ckStr is a CkString CkSFtp_get_ClientIdentifier $this $ckStr set strVal [CkSFtp_get_clientIdentifier $this] CkSFtp_put_ClientIdentifier $this $strVal ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/xojoHttpResponseRef.html Retrieves a specific attribute from a response header field. For example, to get the charset from the content-type header. ```Xojo response.GetHeaderFieldAttr("content-type", "charset") ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/phpHttpResponseRef.html Retrieves a specific attribute of a response header field. For example, to get the charset of the content-type header. ```php string GetHeaderFieldAttr(string fieldName, string attrName) ``` -------------------------------- ### Setting Up Event Callback Object Source: https://www.chilkatsoft.com/refdoc/vcCkZipEntryRef.html Example of how to set up a custom event callback object for zip entry operations. ```cpp CkZipEntry zipentry; MyZipEntryProgress callbackObj; zipentry.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/javaCkHttpResponseRef.html Retrieves a specific attribute of a response header field. For example, to get the charset of the 'content-type' header. ```java boolean success = httpResponse.GetHeaderFieldAttr(fieldName, attrName, outStr); String attributeValue = outStr.getString(); ``` -------------------------------- ### RenderGet Example Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Builds the GET request that would be sent by methods like QuickGetStr, but returns the request instead of sending it. Returns true for success, false for failure. ```php bool RenderGet(string $url, CkString outStr); ``` ```php string renderGet(string url); ``` -------------------------------- ### BeginUpload C# Example Source: https://www.chilkatsoft.com/refdoc/csUploadRef.html Starts an asynchronous upload in C#. A background thread is started for the upload. The upload can be aborted using AbortUpload. ```csharp bool success = chilkatUpload.BeginUpload(); if (success != true) { // Handle error return; } // ... later, check UploadInProgress and UploadSuccess properties ... ``` -------------------------------- ### QuickGetStrAsync Example Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Creates an asynchronous task to call the QuickGetStr method. Returns null on failure. ```php CkTask QuickGetStrAsync(string $url); ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/c_CkHttpResponseRef.html Retrieves a specific attribute of a response header field. For example, to get the charset from the 'content-type' header. ```c BOOL CkHttpResponse_GetHeaderFieldAttr(HCkHttpResponse cHandle, const char *fieldName, const char *attrName, HCkString outStr); const char *CkHttpResponse_getHeaderFieldAttr(HCkHttpResponse cHandle, const char *fieldName, const char *attrName); ``` -------------------------------- ### Get Last Request Start Line Source: https://www.chilkatsoft.com/refdoc/goLang_Rest_Ref.html Retrieves the full start line of the last HTTP request sent by the Rest client. ```Go func (rest *Rest) LastRequestStartLine() string ``` -------------------------------- ### Create CkCertStore Object Source: https://www.chilkatsoft.com/refdoc/vcCkCertStoreRef.html Demonstrates how to create an instance of the CkCertStore class, either on the stack or dynamically. ```cpp // Local variable on the stack CkCertStore obj; // Dynamically allocate/delete CkCertStore *pObj = new CkCertStore(); // ... delete pObj; ``` -------------------------------- ### Basic Zip Event Callback Setup Source: https://www.chilkatsoft.com/refdoc/vcCkZipRef.html Demonstrates the basic setup for using an event callback object with CkZip. An instance of a custom callback class is created and assigned to the CkZip object. ```cpp CkZip zip; MyZipProgress callbackObj; zip.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Year Property Source: https://www.chilkatsoft.com/refdoc/perlCkDtObjRef.html Gets or sets the year. For example, 2012. ```APIDOC ## get_Year ### Description Gets the year, such as 2012. ### Method GET ### Endpoint /DateTime/{id}/Year ## put_Year ### Description Sets the year, such as 2012. ### Method PUT ### Endpoint /DateTime/{id}/Year ### Parameters #### Path Parameters - **id** (string) - Required - The identifier of the DateTime object. #### Request Body - **year** (integer) - Required - The year value. ``` -------------------------------- ### QuickGetStr Example: Download HTML or any Text Content to a String Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Sends an HTTP GET request and returns the text response body. Returns true for success, false for failure. ```php bool QuickGetStr(string $url, CkString outStr); ``` ```php string quickGetStr(string url); ``` -------------------------------- ### WebSocket Event Callback Setup C++ Example Source: https://www.chilkatsoft.com/refdoc/wcppCkWebSocketWRef.html Demonstrates setting up a custom event callback object for WebSocket events in C++. ```cpp CkWebSocketW websocket; MyWebSocketProgressW callbackObj; websocket.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/wcppCkHttpResponseWRef.html Retrieves a specific attribute of an HTTP response header field. For example, to get the charset of a content-type header. ```cpp bool GetHeaderFieldAttr(const wchar_t *fieldName, const wchar_t *attrName, CkString &outStr); const wchar_t *getHeaderFieldAttr(const wchar_t *fieldName, const wchar_t *attrName); ``` -------------------------------- ### Task Event Implementation Example Source: https://www.chilkatsoft.com/refdoc/xojoTaskRef.html Example of how to implement event callbacks by subclassing Chilkat.Task. ```Xojo class MyTask Inherits Chilkat.Task Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Google Authentication C++ Example Source: https://www.chilkatsoft.com/refdoc/wcppCkAuthGoogleWRef.html Demonstrates how to set up an event callback object for Google authentication. This is useful for monitoring progress and aborting operations. ```cpp #include "CkBaseProgressW.h" class MyAuthGoogleProgressW : public CkBaseProgressW { public: MyAuthGoogleProgressW(); virtual ~MyAuthGoogleProgressW(); void AbortCheck(bool *abort); void PercentDone(int pctDone, bool *abort); void ProgressInfo(const wchar_t *name, const wchar_t *value); void TaskCompleted(CkTaskW &task); }; ``` -------------------------------- ### Get Response Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/rubyCkHttpResponseRef.html Retrieves a specific attribute of a response header field. For example, to get the charset of the 'content-type' header. ```ruby # fieldName is a string # attrName is a string # outStr is a CkString (output) status = httpResponse.GetHeaderFieldAttr(fieldName, attrName, outStr) retStr = httpResponse.getHeaderFieldAttr(fieldName, attrName) ``` -------------------------------- ### QuickGetBdAsync Example Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Creates an asynchronous task to call the QuickGetBd method. Returns null on failure. ```php CkTask QuickGetBdAsync(string $url, CkBinData $binData); ``` -------------------------------- ### Get PFX Safe Bag Attribute Example Source: https://www.chilkatsoft.com/refdoc/vcCkPfxRef.html Example demonstrating how to retrieve a 'localKeyId' safe bag attribute for a certificate within a PFX. ```cpp // Example usage for GetSafeBagAttr: // CkString localKeyId; // bool success = pfx.GetSafeBagAttr(false, 0, "localKeyId", localKeyId); // if (success) { // // Use localKeyId.str; // } ``` -------------------------------- ### C++ Example: Implementing DNS Event Callbacks Source: https://www.chilkatsoft.com/refdoc/vcCkDnsRef.html Demonstrates how to set up a custom callback object for DNS operations. This allows your application to receive progress and completion notifications. ```cpp CkDns dns; MyDnsProgress callbackObj; dns.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### XML Node Attributes Example Source: https://www.chilkatsoft.com/refdoc/lianjaXmlRef.html Demonstrates how to get the number of attributes for an XML node. The example XML shows a tag with two attributes. ```xml This is the content ``` -------------------------------- ### SFTP Event Callbacks Example Source: https://www.chilkatsoft.com/refdoc/xojoSFtpRef.html Example of implementing event callbacks by subclassing Chilkat.SFtp. This allows for custom handling of events like AbortCheck, PercentDone, ProgressInfo, and TaskCompleted. ```Xojo class MySFtp Inherits Chilkat.SFtp Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Basic CkDkim Event Callback Setup Source: https://www.chilkatsoft.com/refdoc/vcCkDkimRef.html Demonstrates the basic setup for implementing event callbacks by defining a class that inherits from CkBaseProgress and assigning it to the CkDkim object. ```C++ CkDkim dkim; MyDkimProgress callbackObj; dkim.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Get Attached Message Attribute Source: https://www.chilkatsoft.com/refdoc/pbEmailRef.html Retrieves a header field attribute value for an attached email. For example, to get the 'name' attribute from the 'Content-Type' header. ```vb.net ckGetAttachedMessageAttr(obj.i, index.l, fieldName.s, attrName.s) ``` -------------------------------- ### Custom Upload Class Example Source: https://www.chilkatsoft.com/refdoc/xojoUploadRef.html Example of creating a custom upload class by inheriting from Chilkat.Upload and overriding event methods. ```vb.net class MyUpload Inherits Chilkat.Upload Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Setting Up Event Callbacks Source: https://www.chilkatsoft.com/refdoc/vcCkUnixCompressRef.html Demonstrates how to set up a custom event callback object for Unix Compress operations. The callback object must inherit from CkBaseProgress. ```cpp CkUnixCompress unixcompress; MyUnixCompressProgress callbackObj; unixcompress.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### Get Unprefixed XML Tag (PowerShell) Source: https://www.chilkatsoft.com/refdoc/csXmlRef.html Gets the node's tag without its namespace prefix. For example, 'soapenv:Envelope' becomes 'Envelope'. ```powershell $unprefixedTag = $xml.TagUnprefixed ``` -------------------------------- ### Chilkat OAuth2 Event Callbacks Example Source: https://www.chilkatsoft.com/refdoc/xojoOAuth2Ref.html This example demonstrates how to implement event callbacks for the Chilkat OAuth2 class by subclassing it and overriding event methods. ```vbnet class MyOAuth2 Inherits Chilkat.OAuth2 Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Synchronous Binary GET Request Source: https://www.chilkatsoft.com/refdoc/xojoHttpRef.html Use QuickGet to fetch the binary response body of an HTTP GET request. Check LastStatus for errors (400+). ```xojo Dim http As New Chilkat.Http Dim mb As MemoryBlock mb = http.QuickGet("http://www.chilkatsoft.com/images/logo.png") If http.LastStatus >= 400 Then Print http.LastStatus.String + ": " + http.LastErrorText + "\n" Return End If Print "Downloaded " + mb.Size.ToString + " bytes.\n" ``` -------------------------------- ### Get Unprefixed XML Tag (C#) Source: https://www.chilkatsoft.com/refdoc/csXmlRef.html Gets the node's tag without its namespace prefix. For example, 'soapenv:Envelope' becomes 'Envelope'. ```csharp string unprefixedTag = xml.TagUnprefixed; ``` -------------------------------- ### SCP Event Callback Setup Example Source: https://www.chilkatsoft.com/refdoc/vcCkScpRef.html Demonstrates how to set up an event callback object for SCP operations by inheriting from CkBaseProgress and assigning an instance to the SCP object. ```cpp CkScp scp; MyScpProgress callbackObj; scp.put_EventCallbackObject(&callbackObj); ``` -------------------------------- ### QuickGetSbAsync Example Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Creates an asynchronous task to call the QuickGetSb method. Returns null on failure. ```php CkTask QuickGetSbAsync(string $url, CkStringBuilder $sbContent); ``` -------------------------------- ### Get Pointer to Data at Offset Source: https://www.chilkatsoft.com/refdoc/rubyCkByteDataRef.html Retrieves a pointer to the binary data starting at a specific byte offset. Similar to getData, but starts at the given index. ```ruby binary_data = ckByteData.getDataAt(byteIndex); ``` -------------------------------- ### Example of a Custom Ftp2 Class Implementing Events Source: https://www.chilkatsoft.com/refdoc/xojoFtp2Ref.html This example demonstrates how to create a subclass of Chilkat.Ftp2 to handle event callbacks. It shows the structure for overriding event methods like AbortCheck, PercentDone, ProgressInfo, and TaskCompleted. ```vbnet class MyFtp2 Inherits Chilkat.Ftp2 Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Asynchronous Binary GET Request Task Source: https://www.chilkatsoft.com/refdoc/xojoHttpRef.html Use QuickGetAsync to create a task for an asynchronous binary GET request. Event callbacks occur in a background thread. ```xojo Dim http As New Chilkat.Http Dim task As Chilkat.Task task = http.QuickGetAsync("http://www.chilkatsoft.com/images/logo.png") If task Is Nothing Then Print http.LastErrorText + "\n" Return End If ' The task runs in the background. The application can do other work. ' The application can poll the task's PercentDone property, or ' it can register for the TaskComplete event. task.Run ' Wait for the task to complete... task.WaitUntilComplete Dim mb As MemoryBlock mb = task.Result If task.Status = "success" Then Print "Downloaded " + mb.Size.ToString + " bytes.\n" Else Print task.LastErrorText + "\n" End If ``` -------------------------------- ### Start Keyboard-Interactive Authentication Asynchronously Source: https://www.chilkatsoft.com/refdoc/xojoSshRef.html Creates an asynchronous task to start keyboard-interactive authentication. Use this for non-blocking authentication processes. Introduced in version 9.5.0.46. ```Xojo Function StartKeyboardAuthAsync(login As String) As Chilkat.Task ``` -------------------------------- ### CkFileAccess_getVersion Source: https://www.chilkatsoft.com/refdoc/c_CkFileAccessRef.html Gets the version of the component/library. Example: "10.1.0". ```APIDOC ## CkFileAccess_getVersion ### Description Gets the version of the component/library. ### Method void CkFileAccess_getVersion(HCkFileAccess cHandle, HCkString retval) ### Parameters * **cHandle** (HCkFileAccess) - Handle to the CkFileAccess object. * **retval** (HCkString) - A string object to store the version information. ### Returns Version of the component/library, such as "10.1.0". ``` -------------------------------- ### InitializeSftp C# Example Source: https://www.chilkatsoft.com/refdoc/csSFtpRef.html Initializes the SFTP subsystem after connecting and authenticating. Check InitializeFailCode/Reason on failure. ```csharp public bool InitializeSftp(); ``` -------------------------------- ### Mime Charset Property Example Source: https://www.chilkatsoft.com/refdoc/xojoMimeRef.html Illustrates the usage of the Charset property, which holds the value of the 'charset' attribute in the Content-Type header. This example shows how to set and retrieve the charset. ```xojo Dim mime As New Chilkat.Mime ' Example: Setting and getting the charset mime.Charset = "iso-8859-1" Dim charset As String = mime.Charset ``` -------------------------------- ### Create CkSFtpDirW Object Source: https://www.chilkatsoft.com/refdoc/wcppCkSFtpDirWRef.html Demonstrates how to create an instance of the CkSFtpDirW class, either on the stack or dynamically. ```cpp // Local variable on the stack CkSFtpDirW obj; // Dynamically allocate/delete CkSFtpDirW *pObj = new CkSFtpDirW(); // ... delete pObj; ``` -------------------------------- ### Get Nth Header Field Value Source: https://www.chilkatsoft.com/refdoc/pbEmailRef.html Retrieves the value of the Nth header field. Use NumHeaderFields() to get the total count. Indexing starts at 0. ```chilkat ckGetHeaderFieldValue(obj.i, index.l) ``` -------------------------------- ### Custom ZipCrc Event Implementation Example Source: https://www.chilkatsoft.com/refdoc/xojoZipCrcRef.html Example of how to implement event handlers by subclassing Chilkat.ZipCrc and overriding event methods. ```Xojo class MyZipCrc Inherits Chilkat.ZipCrc Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Synchronous Text GET to String Source: https://www.chilkatsoft.com/refdoc/xojoHttpRef.html Use QuickGetStr to fetch the text response body of an HTTP GET request. Check LastStatus for errors (400+). ```xojo Dim http As New Chilkat.Http Dim strResponse As String strResponse = http.QuickGetStr("http://www.chilkatsoft.com/") If http.LastStatus >= 400 Then Print http.LastStatus.String + ": " + http.LastErrorText + "\n" Return End If Print "Downloaded " + strResponse.Len.ToString + " characters.\n" Print strResponse ``` -------------------------------- ### Chilkat Stream Event Implementation Example Source: https://www.chilkatsoft.com/refdoc/xojoStreamRef.html Example of implementing event methods by subclassing Chilkat.Stream. This demonstrates overriding AbortCheck, PercentDone, ProgressInfo, and TaskCompleted. ```xojo class MyStream Inherits Chilkat.Stream Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### ComInitialize Source: https://www.chilkatsoft.com/refdoc/dataflexCspRef.html Initializes the Csp with the selected ProviderName. ```APIDOC ## Function ComInitialize ### Description Initializes the Csp with the selected ProviderName. ### Returns Boolean: True if initialization was successful, False otherwise. ``` -------------------------------- ### Get Nth Header Field Name Source: https://www.chilkatsoft.com/refdoc/pbEmailRef.html Retrieves the name of the Nth header field. Use NumHeaderFields() to get the total count. Indexing starts at 0. ```chilkat ckGetHeaderFieldName(obj.i, index.l) ``` -------------------------------- ### Get Header Field Attribute Source: https://www.chilkatsoft.com/refdoc/vbnetHttpResponseRef.html Retrieves a specific attribute of a response header field. For example, to get the charset from the content-type header. Returns Nothing on failure. ```vbnet Function GetHeaderFieldAttr(ByVal fieldName As String, ByVal attrName As String) As String ``` -------------------------------- ### C# Example: Fetch Web Pages from Local Cache Source: https://www.chilkatsoft.com/refdoc/csHttpRef.html Demonstrates fetching web pages from the local cache using Chilkat HTTP properties in C#. ```csharp // Check if the last GET was fetched from cache. bool fromCache = http.LastFromCache; // Other cache-related properties include: // NumCacheRoots, NumCacheLevels, AddCacheRoot, FetchFromCache, UpdateCache, // MinFreshPeriod, MaxFreshPeriod, FreshnessAlgorithm, DefaultFreshPeriod, // LMFactor, IgnoreMustRevalidate, IgnoreNoCache ``` -------------------------------- ### Mime ContentType Property Example Source: https://www.chilkatsoft.com/refdoc/xojoMimeRef.html Shows how to get and set the ContentType property, which corresponds to the MIME content type like 'text/plain' or 'multipart/mixed'. ```xojo Dim mime As New Chilkat.Mime ' Example: Setting the content type mime.ContentType = "text/html" Dim contentType As String = mime.ContentType ``` -------------------------------- ### C# QuickGetSb Example Source: https://www.chilkatsoft.com/refdoc/csHttpRef.html Sends an HTTP GET request and returns the text response body in StringBuilder. Returns true for success, false for failure. ```csharp Chilkat.Http http = new Chilkat.Http(); System.Text.StringBuilder sbContent = new System.Text.StringBuilder(); // ... (unlock code) bool success = http.QuickGetSb("https://www.chilkatsoft.com", sbContent); if (success) { Console.WriteLine(sbContent.ToString()); } else { Console.WriteLine(http.LastErrorText); } ``` -------------------------------- ### Spider Event Callbacks Example Source: https://www.chilkatsoft.com/refdoc/xojoSpiderRef.html Example implementation of event methods for a custom Spider subclass. This demonstrates how to handle abort checks, progress, and task completion. ```Xojo class MySpider Inherits Chilkat.Spider Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Create CkSFtpDir Object Source: https://www.chilkatsoft.com/refdoc/vcCkSFtpDirRef.html Demonstrates how to create an instance of the CkSFtpDir class on the stack or dynamically. ```cpp // Local variable on the stack CkSFtpDir obj; // Dynamically allocate/delete CkSFtpDir *pObj = new CkSFtpDir(); // ... delete pObj; ``` -------------------------------- ### VB.NET Get Chilkat Version Example Source: https://www.chilkatsoft.com/refdoc/vbnetAuthAwsRef.html Retrieve the version of the Chilkat component/library. ```vbnet Dim chilkatHttp As New Chilkat.Http Dim version As String version = chilkatHttp.Version Console.WriteLine(version) ' Example Output: "10.1.0" ``` -------------------------------- ### QuickGetStr Source: https://www.chilkatsoft.com/refdoc/xojoHttpRef.html Sends an HTTP GET request and returns the text response body as a String. Returns Nil on failure. ```APIDOC ## QuickGetStr ### Description Sends an HTTP `GET` request to a specified URL, which can include query parameters, and returns the text response body. The response status code is stored in the `LastStatus` property. A response code of 400 or higher indicates a failure. If the error response is text-based and the `KeepResponseBody` property is `True`, it will be available in the `LastResponseBody` property. Returns `Nil` on failure. ### Method GET ### Endpoint `{url}` ### Parameters #### Path Parameters - **url** (String) - Required - The URL to send the GET request to. ### Response #### Success Response - **String** - The text response body. #### Error Response - **Nil** - Indicates failure. ``` -------------------------------- ### Get Chilkat Version Source: https://www.chilkatsoft.com/refdoc/phpCkKeyContainerRef.html Retrieves the current version of the Chilkat library at runtime. ```example string version = chilkatSat.version(); ``` -------------------------------- ### Objective-C Example: Setting up PDF Event Callbacks Source: https://www.chilkatsoft.com/refdoc/objcCkoPdfRef.html Demonstrates how to set up event callbacks for PDF operations by creating a custom progress class and assigning it to the CkoPdf object. ```objective-c CkoPdf *pdf = [[CkoPdf alloc] init]; MyPdfProgress *callbackObj = [[MyPdfProgress alloc] init]; [pdf setEventCallbackObject:callbackObj]; ``` -------------------------------- ### Asynchronous Text GET to String Task Source: https://www.chilkatsoft.com/refdoc/xojoHttpRef.html Use QuickGetStrAsync to create a task for an asynchronous text GET request. Event callbacks occur in a background thread. ```xojo Dim http As New Chilkat.Http Dim task As Chilkat.Task task = http.QuickGetStrAsync("http://www.chilkatsoft.com/") If task Is Nothing Then Print http.LastErrorText + "\n" Return End If ' The task runs in the background. The application can do other work. ' The application can poll the task's PercentDone property, or ' it can register for the TaskComplete event. task.Run ' Wait for the task to complete... task.WaitUntilComplete Dim strResponse As String strResponse = task.Result If task.Status = "success" Then Print "Downloaded " + strResponse.Len.ToString + " characters.\n" Else Print task.LastErrorText + "\n" End If ``` -------------------------------- ### Start Keyboard Authentication Source: https://www.chilkatsoft.com/refdoc/xojoSshTunnelRef.html Initiates keyboard-interactive authentication with the SSH server. Returns an XML string containing prompts if required. ```xojo Function StartKeyboardAuth(login As String) As String ... End Function ``` -------------------------------- ### Create CkCertStoreW Object Source: https://www.chilkatsoft.com/refdoc/wcppCkCertStoreWRef.html Demonstrates how to create an instance of the CkCertStoreW object, either on the stack or dynamically allocated. ```cpp // Local variable on the stack CkCertStoreW obj; // Dynamically allocate/delete CkCertStoreW *pObj = new CkCertStoreW(); // ... delete pObj; ``` -------------------------------- ### CkDtObj_getYear Source: https://www.chilkatsoft.com/refdoc/dd_CkDtObjRef.html Gets or sets the year component of the date/time object. For example, 2012. ```APIDOC ## CkDtObj_getYear / CkDtObj_putYear ### Description Gets or sets the year component of the date/time object, such as 2012. ### Method GET/SET ### Endpoint N/A (Method Call) ### Parameters - **newPropVal** (Integer) - Required - The year value to set. ### Response #### Success Response - **Year** (Integer) - The current year value. #### Response Example ``` 2023 ``` ``` -------------------------------- ### QuickGetSb Example: Load XML from a Remote URL Source: https://www.chilkatsoft.com/refdoc/phpCkHttpRef.html Sends an HTTP GET request and returns the text response body in CkStringBuilder. Clears existing content and replaces it with downloaded content. Returns true for success, false for failure. ```php bool QuickGetSb(string $url, CkStringBuilder $sbContent); ``` -------------------------------- ### ComYear Source: https://www.chilkatsoft.com/refdoc/dataflexDtObjRef.html Gets or sets the year component of a date/time value, for example, 2012. ```APIDOC ## ComYear ### Description The year, such as 2012. ### Method Function / Procedure ### Parameters #### Procedure Set ComYear - **value** (Integer) - The year value to set. ``` -------------------------------- ### Example PrivateKey Event Implementation Source: https://www.chilkatsoft.com/refdoc/xojoPrivateKeyRef.html Demonstrates how to implement event callbacks by subclassing Chilkat.PrivateKey and overriding event methods like AbortCheck, PercentDone, ProgressInfo, and TaskCompleted. ```vbnet class MyPrivateKey Inherits Chilkat.PrivateKey Function AbortCheck() As Boolean Function PercentDone(pctDone As Int32) As Boolean Sub ProgressInfo(name As String, value As String) Sub TaskCompleted(task As Chilkat.Task) End Class ``` -------------------------------- ### Get Header Field Value by Index Source: https://www.chilkatsoft.com/refdoc/dd_CkEmailRef.html Retrieves the value of the Nth header field in an email. Indexing starts at 0. Use NumHeaderFields to get the total count. ```cpp function CkEmail_GetHeaderFieldValue(objHandle: HCkEmail; index: Integer; outStrFieldValue: HCkString): wordbool; stdcall; ``` ```cpp function CkEmail__getHeaderFieldValue(objHandle: HCkEmail; index: Integer): PWideChar; stdcall; ``` -------------------------------- ### Object Creation for CkPublicKeyW Source: https://www.chilkatsoft.com/refdoc/wcppCkPublicKeyWRef.html Demonstrates how to create an instance of the CkPublicKeyW object, either on the stack or dynamically. ```cpp // Local variable on the stack CkPublicKeyW obj; // Dynamically allocate/delete CkPublicKeyW *pObj = new CkPublicKeyW(); // ... delete pObj; ```