Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            tbPort.Text = @"23000";

            List <string> strIPAdresses = SocketServerEx.GetAllIpAddresses();

            foreach (string str in strIPAdresses)
            {
                ListBoxItem itm = new ListBoxItem();
                itm.Content = str;
                cbIPAddresses.Items.Add(itm);
            }
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            tbPort.Text = @"23000";

            List <string> strIPAdresses = SocketServerEx.GetAllIpAddresses();

            foreach (string str in strIPAdresses)
            {
                ListBoxItem itm = new ListBoxItem();
                itm.Content = str;
                cbIPAddress.Items.Add(itm);
            }

            //var localIPs = Dns.GetHostEntry(Dns.GetHostName());
            //tbIpAddress.Text = localIPs.AddressList.First(x => x.AddressFamily == AddressFamily.InterNetwork).ToString();
            //tbPort.Text = "23";
            //btnStartServer.Click += BtnStartServer_Click;
            //btnClose.Click += BtnClose_Click;
            //btnSend.Click += BtnSend_Click;
        }