1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
public void Save(SaveContext context)
{
try
{
CDO.Message iMessage = new CDO.Message();
iMessage.MimeFormatted = true;
iMessage.CreateMHTMLBody(context.url, CDO.CdoMHTMLFlags.cdoSuppressNone, "", "");
ADODB.Stream adodbstream = new ADODB.Stream();
adodbstream.Type = ADODB.StreamTypeEnum.adTypeText;
adodbstream.Charset = Constants.UsasciiString;
adodbstream.Open(Type.Missing, (ConnectModeEnum)0, StreamOpenOptionsEnum.adOpenStreamUnspecified, "", "");
iMessage.DataSource.SaveToObject(adodbstream, Constants.StreamString);
adodbstream.SaveToFile(context.filepath, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
}
catch (Exception ex)
{
MessageBox.Show(Constants.MsgFailedSavingWebPage + context.url + ex.Message, Constants.MsgTitle,
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} |
Partager