好像只要监视一个消息就可以了。例如打开Outlook Express,然后选择脱机工作,那么所有的IE上面的连接都是不可以使用的!然后再让Outlook Express联机使用,那么IE又可以连接了。因此肯定是有一个消息在进行发送,但是这个消息的值是多少,就不得而知了!

解决方案 »

  1.   

    吐 kingron:
    我要是知道,就不在这发帖子了!
      

  2.   

    try this
    :
    1.add a fastnet->TPowersock on form
    2.add a button
    3.
    button click events add scriptbegin
        if    Powersock1.LocalIP = '0.0.0.0' then
            caption := 'no intenet';
    end;
    if localIP = '0.0.0.0' then no intenet!
      

  3.   

    如果你有网卡,即使不在网上LOCALIP = NIC IP,你知道该怎么做了吧!
      

  4.   

    如果你有网卡,即使不在网上LOCALIP = NIC IP,你知道该怎么做了吧!否则为‘0。0。0。0’
      

  5.   

    to atuchina:
    可能我没讲清楚,我要的是‘动态’检测,不是静态!!!也就是说当我从连网状态断开时,程序可以自己检测到,而不是人为的检测!再说你的代码段也有问题,应该是127.0.0.1才对吧?
      

  6.   

    写Powersock的OnDisconnect可以吗?
      

  7.   

    因为我有网卡,所以就是NIC IP,如此就只有根据你使用的SOCK控件来判断了!
      

  8.   

    to zxtyhy:
    我试了powersock-indisconncet,还是不行:(
      

  9.   

    注册表的位置:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings--〉GlobalUserOffline
      

  10.   

    我用WINSIGHT监视拨号,可惜没发现什么有用的东西:(
      

  11.   

    在www.torry.net网站上有几个侦测网络的控件
    Fnugry RASNotify v.1.00 
    http://www.torry.net/vcl/comms/ras/fngb1401.exe
    D3  FWS
     By Gleb Yourchenko. Fnugry RASNotify is a simple component that can be used to notify your application when RAS connection becomes available or lost. It also allows developer to easily enumerate all RAS connections, query connection name, device or status. Fully functional 
    Source: Included  MMJRASCon v.2.0 
    http://www.torry.net/vcl/comms/ras/mmjrascon.zip
    D3  FWS
     By Mihaela Mihaljevic-Jakic. Component that notifies you when the connection to the Internet occurs, lets you connect, informs you of all available RAS entries, lets you edit those entries, delete them and create a new one. Fully functional 
    Source: Included