(Classic ASP) Save Web Page to MHT String
Downloads a web page into a string variable containing MHT. MHT is a web archive with all images and style sheets embedded. It's a MIME-formatted text document. When saved with the .mht extension, Internet Explorer can open and display the page.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Mht")
set mht = Server.CreateObject("Chilkat.Mht")
mhtStr = mht.GetMHT("http://www.google.com/")
If (mht.LastMethodSuccess <> 1) Then
Response.Write "<pre>" & Server.HTMLEncode( mht.LastErrorText) & "</pre>"
Else
Response.Write "<pre>" & Server.HTMLEncode( mhtStr) & "</pre>"
End If
%>
</body>
</html>
|