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
HRESULT ArchiveAndEncrypt(
BSTR bstrHtmlFile,
BSTR bstrMhtFile,
BSTR bstrPassword,
BSTR sEncryptedArchive
);
Parameters
- bstrHtmlFilePath
- [in] BSTR - path to the input HTML file.
- bstrMhtFile
- [in] BSTR - output MHT file.
- bstrPassword
- [in] BSTR - Password to encrypt the MHT file (same password should be used to decrypt the MHT file).
- sEncryptedArchive
- [out] BSTR - MHT Encrypted content.
Return value
Returns S_OK if successful, or an error value otherwise.
Script Syntax
Show Syntax
Boolean ArchiveAndEncrypt(
String bstrHtmlFilePath,
String bstrMhtFile,
String bstrPassword,
String bstrEncryptedArchive
);
Parameters
- bstrHtmlFilePath
- [in] String - path to the input HTML file.
- bstrMhtFile
- [in] String - output MHT file.
- bstrPassword
- [in] String - Password to encrypt the MHT file (same password should be used to decrypt the MHT file).
- sEncryptedArchive
- [out] String - MHT Encrypted content.
ASP Sample: VB Script (without error handling)
<%@ Language=VBScript%>
<%
Set oWAEncoder = Server.CreateObject("WebArchiveX.Encoder")
oWAEncoder.oWABuilder.SetCharset "windows-1255"
Dim sEncData
oWAEncoder.ArchiveAndEncrypt "C:\test\test.html",
"C:\test\test.mht", "myPassword", sEncData
%>
JavaScript (with error handling)
try
{
var oWAEncoder = new ActiveXObject("WebArchiveX.Encoder");
oWAEncoder.oWABuilder.SetCharset("windows-1255");
var sEncData = null;
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.