How to check a web site is running (up) or not ASP.NET and in C# sample code?
Sample code in ASP.NET and C#:
HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(“<Web Site Name>”);
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
if (HttpStatusCode.OK == webResponse.StatusCode)
{
----------------------
----------------------
webResponse.Close();
}
No comments:
Post a Comment