Beispiel #1
0
        /// <summary>
        /// 获取当前在线用户列表
        /// </summary>
        /// <returns>当前在线用户列表</returns>
        public static List <String> GetOnlineUserNames()
        {
            IEnumerator <KeyValuePair <String, Object> > items = CacheManager.GetAll();
            List <String> lstUserNames = new List <String>();

            if (items != null)
            {
                String emptyKey = GetUserUnReadMailCountCacheKey("");

                do
                {
                    if (!String.IsNullOrEmpty(items.Current.Key) && (items.Current.Key.IndexOf(emptyKey) >= 0))
                    {
                        lstUserNames.Add(items.Current.Key.Replace(emptyKey, ""));
                    }
                }while (items.MoveNext());
            }

            return(lstUserNames);
        }