Is there something I can do to test/poll a website to see if it is running from c# (or even vb)?
Loading
Is there something I can do to test/poll a website to see if it is running from c# (or even vb)?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Puran KaushalPosted Jun 10, 2008, 8:56 AM
Make Web Request to particular URL
using System.Net;
using System.IO;
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(URL);
myRequest.Method = "GET";
WebResponse myResponse = myRequest.GetResponse();
StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8);
string result = sr.ReadToEnd();
sr.Close();
myResponse.Close();