Example #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = string.Empty;
            string result = SSTest.Comm.Query.login("0", "1", "fackbook", "1", null, null);

            loginresult       = CommMeth.JsonDeserialize <ResultLogin>(result);
            richTextBox1.Text = result;
        }
Example #2
0
        private void button5_Click(object sender, EventArgs e)
        {
            //server_info si = SSTest.Comm.Query.SelectServer(loginresult, 0);
            string querydata = "&op=get&param=aaa";
            string aaa       = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_bag", querydata);

            richTextBox1.Text = aaa;
            MBag resultmodel = CommMeth.JsonDeserialize <MBag>(aaa);
        }
Example #3
0
        /// <summary>
        /// check_device
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = string.Empty;
            string result = SSTest.Comm.Query.check_device("1", "fackbook", "1");

            ResultCheck resultmodel = CommMeth.JsonDeserialize <ResultCheck>(result);

            richTextBox1.Text = result;
        }
Example #4
0
        private void button3_Click(object sender, EventArgs e)
        {
            richTextBox1.Text = string.Empty;
            si = SSTest.Comm.Query.SelectServer(loginresult, 2);
            string result = SSTest.Comm.Query.login_server(loginresult.data.login_info.uin, loginresult.data.login_info.token, si);

            ResultLoginServer r = CommMeth.JsonDeserialize <ResultLoginServer>(result);

            sessionid         = r.data.session;
            richTextBox1.Text = result;
        }
Example #5
0
        private void button4_Click(object sender, EventArgs e)
        {
            try
            {
                //server_info si = SSTest.Comm.Query.SelectServer(loginresult, 0);
                List <string> ls = new List <string>();
                ls.Add("backpack");

                //Typelist tl = new Typelist();
                //tl.type = new List<string>();
                //tl.type.Add("backpack");

                string tlist = CommMeth.JsonSerialize <List <string> >(ls);
                string tll   = "{" + string.Format("\"type\":{0}", tlist) + "}";
                string aaa   = SSTest.Comm.Query.getuserinfo(si.ip, si.port.ToString(), sessionid, tll);
                //string aaa = SSTest.Comm.Query.getuserinfo(si.ip, si.port.ToString(), sessionid, "{\"type\": [\"backpack\"]}");
                richTextBox1.Text = aaa;
                MUserInfo resultmodel = CommMeth.JsonDeserialize <MUserInfo>(aaa);
            }
            catch (Exception ex)
            {
            }
        }
Example #6
0
        private void button17_Click(object sender, EventArgs e)
        {
            List <object> param = new List <object>();
            //param.Add(0);//1.win,0.lose
            string paramstr = CommMeth.JsonSerialize <List <object> >(param);
            string tl       = "&op=get_info&param={" + string.Format("\"paramlist\":{0}", paramstr) + "}";
            string aaa      = SSTest.Comm.Query.querygateway(si.ip, si.port.ToString(), sessionid, "op_ladder", tl);

            aaa = CommMeth.FormatJsonStr(aaa);
            MBaseProtobuf resultmodel = CommMeth.JsonDeserialize <MBaseProtobuf>(aaa);

            MemoryStream stream = new MemoryStream();
            StreamWriter writer = new StreamWriter(stream);

            writer.Write(resultmodel.data);
            writer.Flush();

            var model = TypeModel.Create();

            stream.Position = 0;
            F_T_CurTime fct = (F_T_CurTime)model.Deserialize(stream, null, typeof(F_T_CurTime));

            richTextBox1.Text = aaa + " time:" + fct.time;
        }