Click or drag to resize

EncodeBase64 Function

Encode a file for e-mail transfer.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION EncodeBase64(
	hSource AS IntPtr,
	hDestination AS IntPtr
) AS LONG
View Source

Parameters

hSource
Type: IntPtr
Handle of the file to encode.
hDestination
Type: IntPtr
Handle of the file to which the encoded text is to be written.

Return Value

Type: Int32
The number of bytes that were encoded.
Remarks
Base64 encoding is used to transmit files attached to messages over the Internet.
Examples
X#
hOut := FCreate("C:\MyFiles\MailOut.txt")
IF hfOut != F_ERROR
        hIn := FOpen("C:\MyFiles\Source.txt", FO_READ)
        IF hIn != F_ERROR
                nTotalBytes := EncodeBase64(hIn, hOut)
                TextBox{,"Encode", "Bytes Encoded: " + ;
                        AsString(nTotalBytes)}:Show()
ENDIF
ENDIF
FClose(hfOut)
FClose(hf)
For a more complete example of EncodeBase64(), see the Mime Encoding sample application (CAVOxx\SAMPLES\INTERNET\MIME\MENCODE.AEF).
See Also

Reference

CLASS CEmail
CLASS CMailAbstract
CLASS CSmtp