コード例 #1
0
        public ServerSelector()
        {
            InitializeComponent();

            _browser = new NetServiceBrowser();
            _browser.DidFindDomain  += new NetServiceBrowser.DomainFound(_browser_DidFindDomain);
            _browser.DidFindService += new NetServiceBrowser.ServiceFound(_browser_DidFindService);
            _browser.SearchForBrowseableDomains();
        }
コード例 #2
0
        public ServerSelector()
        {
            InitializeComponent();

            _browser = new NetServiceBrowser();
            _browser.DidFindDomain  += new NetServiceBrowser.DomainFound(_browser_DidFindDomain);
            _browser.DidFindService += new NetServiceBrowser.ServiceFound(_browser_DidFindService);
            try
            { _browser.SearchForBrowseableDomains(); }
            catch
            {
                MessageBox.Show("Couldn't locate servers via Bonjour.");
            }
        }