Results 1 to 4 of 4

Thread: ping website

  1. #1

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    ping website

    hello guys! how can i ping a particular website? becuase i think Ping class from System.Net.Networkinformation is not designed tp ping Uri but im not sure. any help please.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: ping website

    You don't ping a URL. You ping a machine, hence the fact that you specify an IP address. What exactly is it that you want to know? Whether a particular Web page address is valid? If so then I would guess that WebClient.OpenRead would do the job. I'm not sure but I would expect that it would either throw an exception or return a null reference if the address was not valid.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member daimous's Avatar
    Join Date
    Aug 2005
    Posts
    657

    Re: ping website

    What if the Machine is up/powered on but the Web Service (IIS) is not available? what im trying to do is to check whether the website is available or not. i'll Webclient.OpenRead. Thanks for that anyway.

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: ping website

    Use the HttpWebRequest/WebRequest class to make a call to the URL of the machine or IP address. Then look at the reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width