zoukankan      html  css  js  c++  java
  • 用API测试是否连接网络!

    uses Wininet;

    {$R *.dfm}

    function NetWorkIsConnect(Url:string='http://www.microsoft.com/'): Boolean;
    var
    ConTypes : Integer;
    begin
    Result := false;
    ConTypes := INTERNET_CONNECTION_MODEM + INTERNET_CONNECTION_LAN + INTERNET_CONNECTION_PROXY;
    if InternetGetConnectedState(@ConTypes, 0) then //ConTypes := $01 + $02 + $04;
    Result := True
    else
    if InternetCheckConnection(PWideChar(Url), 1, 0) then
    Result := True;
    end;
  • 相关阅读:
    避免多次提交
    Django 10
    Django 08
    Django 07
    Django 06
    Django 05
    Django 04
    Django 03
    Django 02
    Django 01
  • 原文地址:https://www.cnblogs.com/prtmon/p/2264043.html
Copyright © 2011-2022 走看看