コード例 #1
0
ファイル: Connection.xaml.cs プロジェクト: MaskaSaw/Fast-Type
        private void MultyInvoke()
        {
            Multy multy = new Multy();

            multy.Player1Board.Text = Common.Player1;
            multy.Player2Board.Text = Common.Player2;
            multy.Show();
            Close();
        }
コード例 #2
0
ファイル: Connection.xaml.cs プロジェクト: MaskaSaw/Fast-Type
 private void bConnect_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         remoteIp = IPAddress.Parse(tbIP.Text);
         remoteEP = new IPEndPoint(remoteIp, Port);
         localIp  = Dns.GetHostAddresses(Dns.GetHostName()).Where(x => x.AddressFamily == AddressFamily.InterNetwork).Last();
         Send(Common.Login, "/" + localIp.ToString());
         Multy multy = new Multy();
         multy.Player1Board.Text = Common.Player1;
         multy.Player2Board.Text = Common.Player2;
         multy.Show();
         Close();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }