示例#1
0
        public void moveMine(int adress)
        {
            MineTrace mine = new MineTrace();
            int       x    = 0;
            int       y    = 0;

            x = adress / 7;
            y = adress / 7;
            mine.pBMine.Location = new Point(mine.pBMine.Location.X + minePositionX[x], mine.pBMine.Location.Y + minePositionY[y]);
        }
示例#2
0
        private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
        {
            MineTrace mine = new MineTrace();

            Indata = (string)_sp.ReadExisting();
            if (Indata != null)
            {
                // mine.MoveMine();
            }
        }
示例#3
0
        public void Client(string address, int port)
        {
            MineTrace mine = new MineTrace();

            _socket.Connect(IPAddress.Parse(address), port);
            if (_socket.Connected)
            {
                mine.rtbOutput.Text = "Connected to Pri-US";
            }
            Receive();
        }
示例#4
0
        public void Server(string address, int port)
        {
            MineTrace mine = new MineTrace();

            _socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.ReuseAddress, true);
            _socket.Bind(new IPEndPoint(IPAddress.Parse(address), port));
            bool part1 = _socket.Poll(1000, SelectMode.SelectRead);
            bool part2 = _socket.Available == 0;

            if (part1 && part2)
            {
                mine.rtbOutput.Text = " Connected to Pri-us";
            }
            Receive();
        }
示例#5
0
文件: Login.cs 项目: Charma95/Pri-US
 public Login(MineTrace Parent)
 {
     InitializeComponent();
     parent = Parent;
 }