示例#1
0
        public Uri SearchFor(ISearchCriteria criteria)
        {
            if (_dataBase.HasAlbum(criteria.Value))
            {
                IPAddress ip = null;

                foreach (var i in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
                {
                    if (!i.IsIPv6LinkLocal)
                    {
                        ip = i;
                        break;
                    }
                }

                return(new Uri(string.Format("http://{0}:{1}/{2}", "localhost", ConfigurationManager.AppSettings["port"], Peer.Self.Name)));
            }

            return(null);
        }