WebArchiveX.Encoder - ArchiveAndEncrypt Method


Builds MHT web archive and encrypts it using 3DES encryption algorithm into ".ENC" file. Use this method if the content of the source HTML is sensitive and should be encrypted using password. The ENC file created instead of the MHT file.

IMPORTANT:  In order to view the original MHT file you must use the DecryptToFile or DecryptToStream method with the same password given.     

C++ Syntax

Show Syntax

Script Syntax

Show Syntax

ASP Sample: VB Script (without error handling)

<%@ Language=VBScript%>

<%  ' Create web archive encoder object
    Set oWAEncoder = Server.CreateObject("WebArchiveX.Encoder")

    ' Set a correct charset for the web archive
    oWAEncoder.oWABuilder.SetCharset "windows-1255"

    ' Define a variable into which the encrypted data will be inserted
    Dim sEncData

    ' Make archive and encrypt it info "test.enc" file
    oWAEncoder.ArchiveAndEncrypt "C:\test\test.html", "C:\test\test.mht", "myPassword", sEncData
%>

JavaScript (with error handling)

try
{
    // Create web archive mailer object
    var oWAEncoder = new ActiveXObject("WebArchiveX.Encoder");

    // Set correct Charset for the web archive
    oWAEncoder.oWABuilder.SetCharset("windows-1255");

    // Define a variable into which the encrypted data will be inserted
    var sEncData = null;

    // Make archive and encrypt it info "test.enc" file
    oWAEncoder.ArchiveAndEncrypt('c:\\test\\test.htm', 'c:\\test\\test.mht','myPassword',sEncData);
}
catch(e)
{
    alert('ERROR: ' + e.description);
}

 

- WebArchiveX API - WebArchiveX Website - C Systems Website


C Systems - Creative software solutions since 1996. All rights reserved. Terms of use.