Вниз
Скачать: CL | DM;

Как загрузить в Memo код веб страницы??   Найти похожие ветки 

← →
lestat13   (2007-05-22 01:35) [0]

Как загрузить в Memo код веб страницы?? Может для этого более хороши другие компоненты. В свойствах WebBrowser подобного не нашел (т.е. просмотра кода (команда "Source"  в англ. IE)).


← →
ASoft   (2007-05-22 03:38) [1]


> Как загрузить в Memo код веб страницы??


Memo1.Lines.LoadFromFile("index.htm");


← →
allucard   (2007-05-23 08:16) [2]

uses ActiveX;

function WB_GetHTMLCode(WebBrowser: TWebBrowser; ACode: TStrings): Boolean;
var
 ps: IPersistStreamInit;
 ss: TStringStream;
 sa: IStream;
 s: string;
begin
 ps := WebBrowser.Document as IPersistStreamInit;
 s := "";
 ss := TStringStream.Create(s);
 try
   sa := TStreamAdapter.Create(ss, soReference) as IStream;
   Result := Succeeded(ps.Save(sa, True));
   if Result then ACode.Add(ss.Datastring);
 finally
   ss.Free;
 end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
st: TStrings;

begin

st := TStringList.Create;
WB_GetHTMLCode(WebBrowser1, st);
Memo1.Lines.AddStrings(st);

st.free;
end;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.018 c
2-1179826215
pohil
2007-05-22 13:30
2007.06.10
Flash и Dephi


1-1176810767
Dima63
2007-04-17 15:52
2007.06.10
Как развернуть окно без анимации


2-1179471546
Клара
2007-05-18 10:59
2007.06.10
Фильтрация


1-1176710467
OlegMV
2007-04-16 12:01
2007.06.10
Мерцание TListView


3-1174363086
Lex_!
2007-03-20 06:58
2007.06.10
Заголовки в гриде




   Наверх