Example #1
0
        /// <summary>
        /// 搜索好友
        /// </summary>
        /// <param name="friendName">好友名称</param>
        /// <returns></returns>
        public Stream SearchFriend(string session, string friendName)
        {
            try
            {
                FriendsBLL friBLL = new FriendsBLL();
                string     resul  = friBLL.SearchFriend(session, friendName);

                if (!string.IsNullOrEmpty(resul))
                {
                    return(new MemoryStream(Encoding.UTF8.GetBytes(resul)));
                }
                else
                {
                    return(new MemoryStream(Encoding.UTF8.GetBytes("error")));
                }
            }
            catch (Exception err)
            {
                Logger.Error("SearchFriend Error", err);
                return(new MemoryStream(Encoding.UTF8.GetBytes("error")));
            }
        }