C# TreeView to JSON and Back

Here’s a C# class for persisting a TreeView to JSON, and for restoring a TreeView from JSON. [csharp] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace ChilkatRelease { public class TreeviewPersist { // Persist the TreeView to a JSON string. static public string ToJson(TreeView treeView) …

C++ Zip Example to Append In-Memory Binary and String Data

[code language=”cpp”] void qa_create_zip_from_data(void) { CkZip zip; zip.NewZip("qa_output/test.zip"); // This is the content of the files to be added to the .zip const char *fileContents = "The quick brown fox jumped over the lazy dog. The quick brown fox jumped over the lazy dog. The quick brown fox jumped over …

C Language Callbacks

This example demonstrates the general pattern for implementing some standard event callbacks functions for the Chilkat “C” API.  All Chilkat “classes” what have events will use the standard Chilkat events shown in the example below (AbortCheck, PercentDone, and ProgressInfo). This example demonstrates callbacks for an SFTP download, but the same …

C# SFTP Upload from Byte[]

This example demonstrates how to open a remote file on an SSH/SFTP server, write to the file, and then close it. This is analogous to opening a local file, writing to it, and closing it. The SFTP protocol (i.e. Secure File Transfer over SSH), follows the same concepts as typical …

C# TaskCompleted Event — Updating the UI from a Background Thread

This sample C# snippet demonstrates how to use the TaskCompleted event to be notified when an asynchronous method completes. Given that the event callback is in the background thread, any UI updates must occur on the main thread. This example demonstrates how to do it: [code language=”csharp”] private void taskCompletedToolStripMenuItem_Click(object …

Chilkat C/C++ libraries now available for MAC OS X

The Chilkat C/C++ libraries are now available for MAC OS X. For the download link and more information, see http://www.chilkatsoft.com/installMacOSX.asp Chilkat will soon release MAC OS X compatible builds for Java, Perl, Python, and Ruby. Following that, builds for the IOS (IPhone) will be released, along with Objective-C/C++ native libraries …