DiscoverServers() 공개 정적인 메소드

Discovers the servers on the local machine.
public static DiscoverServers ( ApplicationConfiguration configuration ) : IList
configuration ApplicationConfiguration The configuration.
리턴 IList
예제 #1
0
        /// <summary>
        /// Handles a drop down event for the URL control.
        /// </summary>
        private void UrlCB_DropDown(object sender, EventArgs e)
        {
            UrlCB.Items.Clear();

            // create a table of application descriptions that match the drop down entries.
            List <ApplicationDescription> lookupTable = new List <ApplicationDescription>();

            UrlCB.Tag = lookupTable;

            try
            {
                Cursor = Cursors.WaitCursor;

                try
                {
                    IList <string> serverUrls = ClientUtils.DiscoverServers(m_configuration);

                    // populate the drop down list with the discovery URLs for the available servers.
                    for (int ii = 0; ii < serverUrls.Count; ii++)
                    {
                        // remove duplicates.
                        int index = UrlCB.FindStringExact(serverUrls[ii]);

                        if (index < 0)
                        {
                            UrlCB.Items.Add(serverUrls[ii]);
                        }
                    }
                }
                finally
                {
                    Cursor = Cursors.Default;
                }
            }
            catch (Exception)
            {
                // ignore errors.
            }
        }