線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1243
推到 Plurk!
推到 Facebook!

怎麼將網頁存成*.mht

尚未結案
xuzhenhu
一般會員


發表:4
回覆:3
積分:1
註冊:2003-04-05

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-06-10 12:52:13 IP:220.185.xxx.xxx 未訂閱
我在Delphi K.Top上看到在“請問使用TWebBrowser瀏覽網頁,怎麼將網頁存成*.mht ”上的答案: Saving Full Internet Explorer pages as MHT... This is a Delphi conversion of the routine contributed by Onega found at http://codeguru.earthweb.com/ieprogram/SaveWholePage.html MrBaseball34 //*********************************************************************** // If you don't have these typelibs, import them. //*********************************************************************** uses Winndows, ..., ADODB_TLB, CDO_TLB; //*********************************************************************** // SaveWholePage - // Procedure to save entire web page as MHT file. // // Parameters: // AURL - URL for file to be saved // AFileName - MHT FileName you want web page saves. // AView - Allows you to view the MHT in TWebBrowser // AViewer - WebBrowser control to view the page in. // //*********************************************************************** procedure SaveWholePage ( AURL: String ; AFileName: TFileName ; AView: Boolean ; AViewer: TWebBrowser ); var LMsg: IMessage; LConf: IConfiguration; LFlds: Fields; //這里出現"Undeclared identifier:'Fields' LStrm: _Stream; //這里出現"Undeclared identifier:'_Stream' begin LMsg := CoMessage.Create; LConf := CoConfiguration.Create; try LMsg.Configuration := LConf; LMsg.CreateMHTMLBody(AURL, cdoSuppressAll, '', ''); LStrm := LMsg.GetStream; LStrm.SaveToFile(AFileName, adSaveCreateOverWrite); finally LMsg := nil; LConf := nil; LStrm := nil; if AView then AViewer.Navigate(AFileName); end; end; --- Everything I say is a lie. @>--- 我在自學Delphi, 不知如何處理,請教教我。謝謝!
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-06-11 08:35:33 IP:202.39.xxx.xxx 未訂閱
檢查有沒有 uses ADODB_TLB, CDO_TLB 這兩個 unit
xuzhenhu
一般會員


發表:4
回覆:3
積分:1
註冊:2003-04-05

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-06-11 10:54:51 IP:220.185.xxx.xxx 未訂閱
謝謝hagar,漏掉了uses ADODB_TLB,另他不能調用本地的網頁文件,否則顯示"無效的語法",不知如何處理.
qoo1234
版主


發表:256
回覆:1167
積分:659
註冊:2003-02-24

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-06-11 12:49:33 IP:61.219.xxx.xxx 未訂閱
AURL - URL for file to be saved<---只針對下載的網頁做儲存    另外該程式有一部份參數修改一下..怪怪 class="code"> //cdoSuppressNone: Download all resources referred to // in elements within the resource at // the specified URI (not recursive). //cdoSuppressAll:Do not download any resources referred // to from within the page. 發表人 - qoo1234 於 2004/06/11 13:31:09
hagar
版主


發表:143
回覆:4056
積分:4445
註冊:2002-04-14

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-06-11 12:56:20 IP:202.39.xxx.xxx 未訂閱
感謝 qoo 大大解圍! 
Ktop_Robot
站務副站長


發表:0
回覆:3511
積分:0
註冊:2007-04-17

發送簡訊給我
#6 引用回覆 回覆 發表時間:2007-04-26 13:51:45 IP:000.000.xxx.xxx 未訂閱
提問者您好:


以上回應是否已得到滿意的答覆?


若已得到滿意的答覆,請在一週內結案,否則請在一週內回覆還有什麼未盡事宜,不然,
將由版主(尚無版主之區域將由副站長或站長)自由心證,選擇較合適之解答予以結案處理,
被選上之答題者同樣會有加分獎勵同時發問者將受到扣 1 分的處分。不便之處,請見諒。


有問有答有結案,才能有良性的互動,良好的討論環境需要大家共同維護,感謝您的配合。

------
我是機器人,我不接受簡訊.
系統時間:2024-04-29 3:41:10
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!