How to check programmatically if a website is running

Recently, I got a request from one of my partners to check if a particular website is running or not and this has to be done from a windows service; which should be checking automatically at a given interval once started. Well, you can use WebRequest and WebResponse Classes (under namespace System.Net) to first create…

2

Converting Data to JSON in .NET Framework 3.5

Thanks to Scottgu’s blog (http://weblogs.asp.net/scottgu/archive/2007/10/01/tip-trick-building-a-tojson-extension-method-using-net-3-5.aspx) from where I got this idea to write this blog. I used System.Runtime.Serialization.DataContractJsonSerializer class for serialiazing the data into JSON format instead of System.Web.Script.Serialization.JavaScriptSerializer which is now obselete (can still be used). using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data.Linq;using System.Data.Linq.Mapping;using System.Web.Script.Serialization;using System.Runtime.Serialization;using System.IO; namespace JSONConverter {     class Program {        static…

2

Release – Source Code for the .NET Framework Libraries!!!

The source code for the Microsoft libraries is going to be released later this year.  More information can be found on Scott’s blog Releasing the Source Code for the .NET Framework Libraries (http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx)

1