Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            int    iPort  = 15555;
            string ipAddr = "47.99.149.104";

            TcpConnet.Get_TcpConnet().ConnectToServer(iPort, ipAddr);
            TcpConnet.Get_TcpConnet().addForm(this);
        }
Пример #2
0
        private void ReadDb_Click(object sender, EventArgs e)
        {
            string strSql = "SELECT [ID], [Name] FROM  Points";
            int    iCol   = 2;
            //cols.Add("1");
            //cols.Add("2");
            string strBody, strPacket;

            JsonOp.PacketSelectString(strSql, iCol, out strBody);
            uint nn = TcpConnet.Get_TcpConnet().getClientNo();

            JsonOp.PacketToSend(nn, (int)enumFunctionNo.ExcSelectCmd, strBody, out strPacket);
            TcpConnet.Get_TcpConnet().SendData(strPacket);
        }
Пример #3
0
        private void ConnectDb_Click(object sender, EventArgs e)
        {
            string dbname   = "sql2012";
            string username = "******";
            string pwd      = "geomos_admin_2006";
            string strBody;
            string strPacket;

            JsonOp.PacketConnectString(username, pwd, dbname, 1, out strBody);
            uint nn = TcpConnet.Get_TcpConnet().getClientNo();

            JsonOp.PacketToSend(nn, (int)enumFunctionNo.ConnectSql, strBody, out strPacket);
            TcpConnet.Get_TcpConnet().SendData(strPacket);
        }
Пример #4
0
        private void logon_Click(object sender, EventArgs e)
        {
            //TcpConnet.Get_TcpConnet().SendData("abccc");
            string strBody;
            string strPacket;
            string strUser = "******";
            string strPwd  = "admin";

            JsonOp.PacketLogOnInfo(strUser, strPwd, out strBody);
            JsonOp.PacketToSend(0, (int)enumFunctionNo.LogIn, strBody, out strPacket);
            TcpConnet.Get_TcpConnet().SendData(strPacket);

            // TcpConnet.Get_TcpConnet().SendData("00005");
        }
Пример #5
0
        private void SecletThread(object obj)
        {
            string strSql = "select * from Table_ee";
            int    icold = 2;
            string strBody, strPacket;

            JsonOp.PacketSelectString(strSql, icold, out strBody);
            uint nn = TcpConnet.Get_TcpConnet().getClientNo();

            JsonOp.PacketToSend(nn, (int)enumFunctionNo.ExcSelectCmd, strBody, out strPacket);
            TcpConnet.Get_TcpConnet().SendData(strPacket);

            Thread.Sleep(1000 * 60 * 5);//每5分钟发一次查询命令
        }