Snake-ssr » 04 дек 2009, 15:59
Вот это должно работать
uses
windows,
registry,
ShellAPI,
SysUtils,
Psapi,
tlhelp32,
Messages,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,
shlObj, activeX, filectrl, comObj,WinSock,mshtml, WinINet,OleCtrls, SHDocVw, HTTPApp, HTTPProd,
ComCtrls,ExtCtrls;
var
WebBrowser1:TWebBrowser;
HTMLDocument: IHTMLDocument2;
htm:String;
neton:boolean;
function RealOnline:boolean;
function base:boolean;
begin
WebBrowser1:=TWebBrowser.Create(WebBrowser1);
if htm<>'
http://www.ya.ru/' then WebBrowser1.Navigate('
www.ya.ru');
if htm<>'
http://www.yandex.ru/' then WebBrowser1.Navigate('
www.yandex.ru');
htm:='';
while Webbrowser1.ReadyState <> READYSTATE_INTERACTIVE do
application.ProcessMessages;
HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
htm:=HTMLDocument.url;
if (htm='
http://www.ya.ru/') or (htm='
http://www.yandex.ru/') then neton:=true else neton:=false;
end;
function RealOnline:boolean;
begin
base;
HTMLDocument:=nil;
result:=neton;
end;
Вот это должно работать
uses
windows,
registry,
ShellAPI,
SysUtils,
Psapi,
tlhelp32,
Messages,
Variants,
Classes,
Graphics,
Controls,
Forms,
Dialogs,
StdCtrls,
shlObj, activeX, filectrl, comObj,WinSock,mshtml, WinINet,OleCtrls, SHDocVw, HTTPApp, HTTPProd,
ComCtrls,ExtCtrls;
var
WebBrowser1:TWebBrowser;
HTMLDocument: IHTMLDocument2;
htm:String;
neton:boolean;
function RealOnline:boolean;
function base:boolean;
begin
WebBrowser1:=TWebBrowser.Create(WebBrowser1);
if htm<>'http://www.ya.ru/' then WebBrowser1.Navigate('www.ya.ru');
if htm<>'http://www.yandex.ru/' then WebBrowser1.Navigate('www.yandex.ru');
htm:='';
while Webbrowser1.ReadyState <> READYSTATE_INTERACTIVE do
application.ProcessMessages;
HTMLDocument := WebBrowser1.Document as IHTMLDocument2;
htm:=HTMLDocument.url;
if (htm='http://www.ya.ru/') or (htm='http://www.yandex.ru/') then neton:=true else neton:=false;
end;
function RealOnline:boolean;
begin
base;
HTMLDocument:=nil;
result:=neton;
end;