protected string GetTime() { string ts; STCacheObject <string> stObject = Cache[CACHE_KEY] as STCacheObject <string>; if (stObject == null) { ts = new STCacheObject <string>(CACHE_KEY, GenerateTimeStamp).Data; } else { ts = stObject.Data + " <b>(Cached)</b>"; } return(ts); }
public string GetTime() { string ts; STCacheObject <string> stObject = Cache[CACHE_KEY] as STCacheObject <string>; if (stObject == null) { //Cache[CACHE_KEY] = ts = DateTime.Now.ToLongTimeString(); //ts = DateTime.Now.ToLongTimeString(); //Cache.Insert(CACHE_KEY, ts, null, // Cache.NoAbsoluteExpiration, TimeSpan.FromSeconds(5), // CacheItemPriority.Normal, HandleRemoveNotification); ts = new STCacheObject <string>(CACHE_KEY, GenerateTimeStamp).Data; } else { ts = stObject.Data + "<b> GetTime (Cached)</b> "; } return(ts); }