MFC Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

MFC Examples

Bounced Mail
Bz2
Certificates/Keys
Charset
CSV
Diffie-Hellman
DKIM / DomainKey
DSA
Email Object
Encryption
FileAccess
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
MIME
NTLM
POP3
RSA
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
Zip
Amazon S3


 

 

 

 

 

 

 

 

UU Encoding and Decoding

Demonstrates how to UU encode and decode.

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries
FreeBSD C++ Libraries
HP-UX C++ Libraries
BlackBerry QNX C++ Libraries
// Needs #include <CkCrypt2.h>

    CkString strOut;

    CkCrypt2 crypt;

    //  Any string argument automatically begins the 30-day trial.
    bool success;
    success = crypt.UnlockComponent("30-day trial");
    if (success != true) {
        strOut.append(crypt.lastErrorText());
        strOut.append("\r\n");
        SetDlgItemText(IDC_EDIT1,strOut.getUnicode());
        return;
    }

    const char * s1;
    const char * s2;
    const char * s3;

    s1 = "This string is to be UU encoded";

    crypt.put_UuMode("666");
    crypt.put_UuFilename("something.txt");

    //  UU encode:
    s2 = crypt.encodeString(s1,"ansi","uu");

    //  Note: Call crypt.Encode instead of crypt.EncodeString
    //  to UU encode binary bytes (i.e. non-text binary data).

    strOut.append(s2);
    strOut.append("\r\n");

    //  UU decode:
    CkCrypt2 crypt2;
    s3 = crypt2.decodeString(s2,"ansi","uu");

    //  Note: Likewise, call crypt.Decode to decode non-text binary data.

    strOut.append(s3);
    strOut.append("\r\n");

    //  Show the file permissions mode and filename found
    //  in the UU encoded data:
    strOut.append("UuMode = ");
    strOut.append(crypt2.uuMode());
    strOut.append("\r\n");
    strOut.append("UuFilename = ");
    strOut.append(crypt2.uuFilename());
    strOut.append("\r\n");


    SetDlgItemText(IDC_EDIT1,strOut.getUnicode());

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