Files
Umbraco-CMS/umbraco/presentation/keepAliveService.cs
Shandem f6d0d043b5 DO NOT DOWNLOAD. DOWNLOAT LATEST STABLE FROM RELEASE TAB
Created 4.1.0 branch

[TFS Changeset #55082]
2009-06-19 07:39:16 +00:00

31 lines
655 B
C#

using System;
using System.Diagnostics;
using System.Net;
using System.Web;
namespace umbraco.presentation
{
/// <summary>
/// Summary description for keepAliveService.
/// </summary>
public class keepAliveService
{
public static void PingUmbraco(object sender)
{
if (sender == null)
return;
string url = string.Format("http://{0}/ping.aspx", ((HttpContext)sender).Application["umbracoUrl"]);
try
{
using (WebClient wc = new WebClient())
{
wc.DownloadString(url);
}
}
catch(Exception ee)
{
Debug.Write(string.Format("Error in ping({0}) -> {1}", url, ee));
}
}
}
}