Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

PowerShell Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
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)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(PowerShell) Download a Zip from a URL and OpenFromMemory. (No .zip fie is created)

Demonstrates how to download a .zip from a URL, opens the Zip, and gets the contents of a file. No file is ever written.

Chilkat .NET Downloads

Chilkat .NET Assemblies

Chilkat for Mono

Chilkat for Xamarin

[Reflection.Assembly]::LoadFile("C:\myAssemblies\ChilkatDotNet2.dll")

#  This example requires the Chilkat API to have been previously unlocked.
#  See Global Unlock Sample for sample code.

$http = New-Object Chilkat.Http

#  This URL is valid and can be tested...
$zipFileBytes = $http.QuickGet("http://chilkatdownload.com/example_data/hamlet.zip")
if ($http.LastMethodSuccess -ne $true) {
    $($http.LastErrorText)
    exit
}

$zip = New-Object Chilkat.Zip

#  Open the zip from the in-memory bytes.
$success = $zip.OpenFromMemory($zipFileBytes)
if (!$success) {
    $($zip.LastErrorText)
    exit
}

#  Get the entry for the file we want..
$entry = $zip.GetEntryByName("hamlet.xml")
if ($zip.LastMethodSuccess -ne $true) {
    $($zip.LastErrorText)
    exit
}

#  Convert all line endings to CRLF (if needed)
$lineEndingBehavior = 2
$xmlStr = $entry.UnzipToString($lineEndingBehavior,"utf-8")
if ($entry.LastMethodSuccess -ne $true) {
    $($entry.LastErrorText)

    exit
}

#  The XML in this case is about 274K, so let's just examine the last 20 lines...
$sb = New-Object Chilkat.StringBuilder
$sb.Append($xmlStr)

$($sb.LastNLines(20,$true))


 

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