Visual Basic Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

VB Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
SFTP
SMTP
Socket
Spider
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
Bzip2
PPMD
Deflate
LZW


VB Strings
VB Byte Array

 

 

 

 

 

 

 

SHA-1 Hash

Download Chilkat Crypt ActiveX

Visual Basic sample code to create a SHA-1 hash of a file.

Private Sub Command1_Click()

    Dim nfile As Long
    Dim filelength As Long ' length of document
    Dim filedata As Variant ' file data read from document
        
    Dim crypt As New ChilkatCrypt2
    crypt.UnlockComponent "Anything for 30-day trial"
    
    ' Set the hash algorithm
    crypt.HashAlgorithm = "sha-1"
    
    ' Read the file as binary data.
    nfile = FreeFile
    Open "hashThis.txt" For Binary As nfile
    filelength = LOF(nfile)
    filedata = InputB(filelength, nfile)
    
    ' Provide output as a hex-encoded string.
    crypt.EncodingMode = "hex"
    Text1.Text = crypt.HashBytesENC(filedata)
    
    ' Do it again, but return the result as a base-64 encoded string.
    crypt.EncodingMode = "base64"
    Text2.Text = crypt.HashBytesENC(filedata)
    
End Sub
 

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