Z
zhyanfeng
Unregistered / Unconfirmed
GUEST, unregistred user!
我从程序员杂志合订本看到这样一个函数,判断计算机是否连上internet inetisoffline
为什么我用拔号上网不能正常判断?
源码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function InetIsOffline(flag:integer):boolean; stdcall;external 'c:/winnt/system32/URL.DLL';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
IF InetIsOffline(0) then
begin
showmessage('aaaaaaaaaaaa');
end
else
begin
showmessage('bbbbbbbbbbbbbb');
end;;
end;
end.
为什么我用拔号上网不能正常判断?
源码如下:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function InetIsOffline(flag:integer):boolean; stdcall;external 'c:/winnt/system32/URL.DLL';
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
IF InetIsOffline(0) then
begin
showmessage('aaaaaaaaaaaa');
end
else
begin
showmessage('bbbbbbbbbbbbbb');
end;;
end;
end.