private void Button7_Click(object sender, EventArgs e)
        {
            // 数据发送
            NetHandle handle = new NetHandle( );

            if (textBox5.Text.IndexOf('.') >= 0)
            {
                string[] values = textBox5.Text.Split('.');
                handle = new NetHandle(byte.Parse(values[0]), byte.Parse(values[1]), ushort.Parse(values[2]));
            }
            else
            {
                handle = int.Parse(textBox5.Text);
            }


            int      count = int.Parse(textBox6.Text);
            DateTime start = DateTime.Now;

            for (int i = 0; i < count; i++)
            {
                OperateResult <NetHandle, string[]> read = simplifyClient.ReadCustomerFromServer(handle, textBox4.Text.Split(new char[] { ';' }));
                if (read.IsSuccess)
                {
                    textBox8.Lines = read.Content2;
                }
                else
                {
                    MessageBox.Show(Program.Language == 1 ? "读取失败:" : "Read Failed:" + read.ToMessageShowString( ));
                }
            }

            textBox7.Text = (DateTime.Now - start).TotalMilliseconds.ToString("F2");
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");

            Console.WriteLine(System.Globalization.CultureInfo.CurrentCulture.ToString());


            NetSimplifyClient AccountSimplifyClient = new NetSimplifyClient("127.0.0.1", 23456);
            OperateResult <NetHandle, string> read  = AccountSimplifyClient.ReadCustomerFromServer(1, "");

            if (read.IsSuccess)
            {
                Console.WriteLine("Handle:" + read.Content1);
                Console.WriteLine(read.Content2);
            }
            else
            {
                Console.WriteLine("失败:" + read.Message);
            }



            Console.ReadLine( );
        }
Esempio n. 3
0
        private void CheckServer( )
        {
            NetSimplifyClient simplifyClient = new NetSimplifyClient("118.24.36.220", 18467);

            HslCommunication.OperateResult <HslCommunication.NetHandle, string> read = simplifyClient.ReadCustomerFromServer(101, "2.1.3");
        }