Internet Accessible?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • perspolis

    Internet Accessible?

    Hi all
    How can I find that user is connected to internet or not?

    thanks in advance


  • Michael Nemtsev

    #2
    Re: Internet Accessible?

    Hello perspolis,

    Google first
    http://groups.google.com/groups/sear...check+internet, as well as

    sample

    pHi all
    pHow can I find that user is connected to internet or not?
    pthanks in advance
    p>
    ---
    WBR,
    Michael Nemtsev :: blog: http://spaces.live.com/laflour

    "At times one remains faithful to a cause only because its opponents do not
    cease to be insipid." (c) Friedrich Nietzsche


    Comment

    • Peter Thornqvist

      #3
      Re: Internet Accessible?

      Is there an equivalent to InternetCheckCo nnection in .Net? If not, why not
      interop it?

      Here's another alternative:

      using System.Net;

      HttpWebRequest request =
      (HttpWebRequest )WebRequest.Cre ate(@"http://www.microsoft.c om");


      An exception indicates that the site isn't reachable thus probably there is
      no internet connection (ms site could be down as well, but that is not as
      probable).


      --
      Regards, Peter

      "Michael Nemtsev" <nemtsev@msn.co mskrev i meddelandet
      news:1799a79b3a efaf8c8aceaa382 3c53@msnews.mic rosoft.com...
      Hello perspolis,
      >
      Google first
      http://groups.google.com/groups/sear...check+internet, as well as

      sample
      pHi all
      pHow can I find that user is connected to internet or not?
      pthanks in advance
      p---
      WBR,
      Michael Nemtsev :: blog: http://spaces.live.com/laflour
      >
      "At times one remains faithful to a cause only because its opponents do
      not cease to be insipid." (c) Friedrich Nietzsche
      >
      >




      Comment

      • Ciaran O''Donnell

        #4
        Re: Internet Accessible?

        This is the check for network connectivity (in .NET 2.0):

        System.Net.Netw orkInformation. NetworkInterfac e.GetIsNetworkA vailable();

        This will tell you only if you are connected to something (network, dialup,
        wireless etc), not whether the internet is contactable. The best bet is to
        try and do what you want to do and handle any exceptions, or try and open
        something like google for microsoft to check for connectivity.

        HTH

        Ciaran O'Donnell



        "Peter Thornqvist" wrote:
        Is there an equivalent to InternetCheckCo nnection in .Net? If not, why not
        interop it?
        >
        Here's another alternative:
        >
        using System.Net;
        >
        HttpWebRequest request =
        (HttpWebRequest )WebRequest.Cre ate(@"http://www.microsoft.c om");
        >
        >
        An exception indicates that the site isn't reachable thus probably there is
        no internet connection (ms site could be down as well, but that is not as
        probable).
        >
        >
        --
        Regards, Peter
        >
        "Michael Nemtsev" <nemtsev@msn.co mskrev i meddelandet
        news:1799a79b3a efaf8c8aceaa382 3c53@msnews.mic rosoft.com...
        Hello perspolis,

        Google first
        http://groups.google.com/groups/sear...check+internet, as well as

        sample
        pHi all
        pHow can I find that user is connected to internet or not?
        pthanks in advance
        p---
        WBR,
        Michael Nemtsev :: blog: http://spaces.live.com/laflour

        "At times one remains faithful to a cause only because its opponents do
        not cease to be insipid." (c) Friedrich Nietzsche
        >
        >
        >
        >
        >
        >

        Comment

        • Ciaran O''Donnell

          #5
          RE: Internet Accessible?

          You can also handle events with network availability at
          System.Net.Netw orkInformation. NetworkChange.N etworkAvailabil ityChanged
          and you can ping webserver to check for connectivity too.
          System.Net.Netw orkInformation. Ping

          HTH

          Ciaran O'Donnell


          "perspolis" wrote:
          Hi all
          How can I find that user is connected to internet or not?
          >
          thanks in advance
          >
          >
          >

          Comment

          Working...