internal void SaveRequestUrlData(HttpContext context, RequestUrlData data) { if (null == context) throw new ArgumentNullException("context"); if (null == data) throw new ArgumentNullException("data"); lock (lockObject) { string fileName = Path.Combine(Statistic.GetStatisticsPath(context), @"Requests\Requests_{0}_{1}.xml"); fileName = string.Format(CultureInfo.InvariantCulture, fileName, context.Timestamp.Year, context.Timestamp.Month); // At last, write the data back to the login statistics file and // put the data object back to the cache. try { data.WriteXml(fileName); } catch (UnauthorizedAccessException ex) { HandleNoAccessException(Statistic.GetStatisticsPath(context), ex); } catch(SecurityException ex) { HandleNoAccessException(Statistic.GetStatisticsPath(context), ex); } catch (Exception ex) { HandleException(Statistic.GetStatisticsPath(context), ex); } context.Cache.Insert(fileName, data, null, Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration); } }