Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var xcs  = Convert.ToInt32(textBox2.Text);
            var xccs = Convert.ToInt32(textBox3.Text);

            for (var i = 0; i < xcs; i++)
            {
                var i1 = i;
                new Thread(() =>
                {
                    CoreLog.Info("xc :" + i1 + " Start");
                    var cc = new CoreClient(textBox1.Text);
                    for (var j = 0; j < xccs; j++)
                    {
                        CoreLog.Info("xc :" + i1 + " j :" + j + " ks");
                        var n    = CorePublic.GenerateId();
                        var user = new user {
                            id = n, name = i1 + "并发测试" + j
                        };
                        var ret = cc.Send <int>("Insert", user);
                        CoreLog.Info("id :" + n + " xc :" + i1 + " j :" + j + " " + (ret == 1));
                        Thread.Sleep(10);
                    }
                }
                           ).Start();
            }
        }
Beispiel #2
0
        public void InsertEx(object sender, RoutedEventArgs e)
        {
            var user = new user {
                id = Math.Abs(CorePublic.GenerateId()), name = "李四"
            };
            var ret = App.CreateWsService().Insert(user);

            MainWindowModel.Msg = ret.ToString();
        }
Beispiel #3
0
        public void PostUser2()
        {
            var ret = Api.PostUser(new user
            {
                id   = Math.Abs(CorePublic.GenerateId()).ToString(),
                name = "李四"
            });

            Xxk = ret + Environment.NewLine + Xxk;
        }
Beispiel #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            var cc = new CoreClient(textBox1.Text);

            CoreLog.Info(" ks");
            var n    = CorePublic.GenerateId();
            var user = new user {
                id = n, name = "单次测试"
            };
            var ret = cc.Send <int>("Insert", user);

            CoreLog.Info("id :" + n + "  " + (ret == 1));
            MessageBox.Show(@"调用成功返回:" + ret);
        }
Beispiel #5
0
        private void button2_Click(object sender, EventArgs e)
        {
            var cc = new WsSoapClient();

            cc.Endpoint.Address = new EndpointAddress(textBox1.Text);
            CoreLog.Info(" ks");
            var n    = CorePublic.GenerateId();
            var user = new user {
                id = n, name = "单次测试"
            };
            var ret = cc.Insert(user);

            CoreLog.Info("id :" + n + "  " + ret);
            MessageBox.Show(@"调用成功返回:" + ret);
            cc.Close();
        }