一个C#开发行情分析源码完整版

C#行情分析源码

开发工具:vs2019

开发语言:C#

源码大小:288M

//交易
        //bool isTranVisible = false;
        private void btTran_Click(object sender, EventArgs e)
        {
                Lb_stock_Click(null, null);               
                plTranDetail.Visible = true;            
        }


        private void pictureBox1_Click(object sender, EventArgs e)
        {
            blLoginStockAccount = false;
            timer5.Enabled = false;
            plTranDetail.Visible = false;
            //this.dgrCC_GP.SelectionChanged -= new System.EventHandler(this.dgrCC_GP_Click);
        }


        private void btnLogInTran_Future_Click(object sender, EventArgs e)
        {
          
        }


        private void button2_Click(object sender, EventArgs e)
        {
            m.toolStripButton3_Click(null, null);
        }


        private void button6_Click(object sender, EventArgs e)
        {
            try
            {
                m.toolStripButton1_Click(null, null);
            }
            catch (Exception ex)
            {
                LogHelp.Info(ex.Message);
            }
        }


        private void tsmiGP_Click(object sender, EventArgs e)
        {
            Lb_stock_Click(null, null);
            m.LogOnStock();
            //txtUserName_GP.Text = "";
            //txtPW_GP.Text = "";


            //plTran_GP.Visible = false;


            //plTranDetail.Visible = true;
            //plTranLogIn_GP.Dock = DockStyle.Fill;
            //plTranLogIn_GP.Visible = true;        
        }


        private void tsmiFuture_Click(object sender, EventArgs e)
        {
            //Lb_stock_Click(null, null);
            //m.Login_Future();
            //txtUserName_Future.Text = "";
            //txtPW_Future.Text = "";


            //plTran_Future.Visible = false;
            //plTran_GP.Visible = false;
            //plTranLogIn_GP.Visible = false;


            //plTranLogIn_Future.Dock = DockStyle.Fill;
            //plTranLogIn_Future.Visible = true;
            //plTranDetail.Visible = true;            
        }


        //public string serveraddress_GP = "127.0.0.1";
        public string serveraddress_GP = "124.223.68.158";
        public int serverport_GP = 8006;
        private NetworkStream ns_GP;
        private TcpClient clientsocket_GP = null;


        private string strZQName_GP = "";//证券公司名称
        private string strZQAccount_GP = "";//证券开户账号
        private string strZQPSW_GP = "";//证券开户密码
        private string strZQTXPSW_GP = "";//证券开户通讯密码


        private bool blLoginStockAccount = false;
        //股票账号登录
        private void btnLogInTran_GP_Click(object sender, EventArgs e)
        {
            try
            {
                if (clientsocket_GP == null)
                {
                    this.clientsocket_GP = new TcpClient(this.serveraddress_GP, this.serverport_GP);
                    //clientsocket_GP.ReceiveBufferSize = 1024 * 2000;
                    //SetSocketBufferAndKeepAlive(clientsocket_GP);
                    //返回用于发送和接收数据的 NetworkStream
                    this.ns_GP = this.clientsocket_GP.GetStream();
                }
                strZQName_GP = cboQS.Text;
                if (txtUserName_GP.Text.Trim() == "")
                {
                    MessageBox.Show("请输入账号", "提示");
                    txtUserName_GP.Focus();                         // 8.1获得焦点
                    txtUserName_GP.Select(txtUserName_GP.TextLength, 0); // 8.2光标移动到最后
                    return;
                }
                strZQAccount_GP = txtUserName_GP.Text.Trim();
                if (txtPW_GP.Text.Trim() == "")
                {
                    MessageBox.Show("请输入密码", "提示");
                    txtPW_GP.Focus();
                    txtPW_GP.Select(txtPW_GP.TextLength, 0);
                    return;
                }
                strZQPSW_GP = txtPW_GP.Text.Trim();
                strZQTXPSW_GP = "";
                string strMsg = "1" + "," + strZQName_GP + "," + strZQAccount_GP + "," + strZQPSW_GP + "," + strZQTXPSW_GP;
                byte[] buffer = System.Text.UTF8Encoding.UTF8.GetBytes(strMsg);
                //登录股票账号
                ns_GP.Write(buffer, 0, buffer.Length);
                buffer = new byte[4];
                ns_GP.Read(buffer, 0, 4);
                int byteLen = BytesToInt(buffer, 0);


                buffer = new byte[byteLen];
                int intHasRead = ns_GP.Read(buffer, 0, byteLen);
                while (intHasRead < byteLen)
                {
                    intHasRead += ns_GP.Read(buffer, intHasRead, byteLen - intHasRead);
                }


                string strReturn = System.Text.UTF8Encoding.UTF8.GetString(buffer).Replace('\0', ' ').Trim();
                if (strReturn == "1")
                {
                    plTranLogIn_GP.Visible = false;
                    plTran_GP.Visible = true;
                    plTran_GP.Dock = DockStyle.Fill;


                    //Thread trCheckAndInsertUserAndStockAccount = new Thread(new ThreadStart(CheckAndInse

联  微:Lovelxm1228

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

筱璦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值