Exemplo n.º 1
0
        public void SetMSSV(string IP, string MSSV)
        {
            MayTinh mt = GetMayTinh(IP);

            if (mt != null)
            {
                mt.TextPhiaDuoi = MSSV;
            }
        }
Exemplo n.º 2
0
        public void SetTenMay(string IP, string TenMay)
        {
            MayTinh mt = GetMayTinh(IP);

            if (mt != null)
            {
                mt.TextTren = TenMay;
            }
        }
Exemplo n.º 3
0
        public bool SetPort(string IP, int Port)
        {
            MayTinh mt = GetMayTinh(IP);

            if (mt != null)
            {
                mt.Port = Port;

                return(true);
            }
            return(false);
        }
Exemplo n.º 4
0
        public bool SetStatusClientConnected(string IP)
        {
            MayTinh mt = GetMayTinh(IP);

            if (mt != null)
            {
                mt.MauManHinh = Brushes.Red;

                return(true);
            }
            return(false);
        }
Exemplo n.º 5
0
        public ArrayList XuatIP(int batdau, int cuoi, int chieudai)
        {
            ArrayList tam = new ArrayList();

            for (int i = batdau; i < chieudai && i <= cuoi; i++)
            {
                string          ip   = "192.168.255." + i.ToString();
                MayTinh.MayTinh temp = new MayTinh.MayTinh();
                temp.IP = ip;
                tam.Add(temp);
            }
            return(tam);
        }
Exemplo n.º 6
0
        private void ThreadSendMessage(object Data)
        {
            string temp            = (string)Data;
            string IP              = temp.Split('-')[0];
            string MessageToClient = temp.Split('-')[1];

            MayTinh.MayTinh mt = mangMayTinh.GetMayTinh(IP);

            IPEndPoint    ep     = new IPEndPoint(IPAddress.Parse(mt.IP), mt.Port);
            TcpClient     client = new TcpClient(ep);
            NetworkStream ns     = client.GetStream();

            byte[] data = new byte[1024];
            data = Encoding.ASCII.GetBytes(MessageToClient);
            ns.Write(data, 0, data.Length);
            ns.Close();
            client.Close();
        }