January 20, 2011

Code snippet for Checking Internet Connection in C#

private Boolean fnChkInternetConn()
{
Boolean bol = false;
System.Net.HttpWebRequest objreq = (System.Net.HttpWebRequest)System.Net.HttpWebRequest.Create("http://www.google.com");
try
{
System.Net.HttpWebResponse objres = (System.Net.HttpWebResponse)objreq.GetResponse();
objreq.Abort();
if (objres.StatusCode == System.Net.HttpStatusCode.OK)
{
bol = true;
}
}
catch (System.Net.WebException weberrt)
{
bol = false;
}
catch (Exception except)
{
bol = false;
}
return bol;
}

No comments:

Migrate SharePoint 2010 Infopath to SharePoint Online

 Below are the steps to follow to migrate the Infopath data to SP Online.