通讯平台登陆代码

来源:互联网 发布:淘宝运营视频论坛 编辑:程序博客网 时间:2024/04/29 09:00

 

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;using System.Text.RegularExpressions;namespace PrintStock{    public partial class Login : Form    {        public Login()        {            InitializeComponent();        }        private void Login_Load(object sender, EventArgs e)        {            this.Height = 180;            //通讯平台地址            ipBox1.Text = SetConfig.GetConfigString("", "ConnIP");            //通讯平台端口            txtPort.Text = SetConfig.GetConfigString("", "ConnPort");        }        /// <summary>        /// 打开配置 按钮事件        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void btnSet_Click(object sender, EventArgs e)        {            if (this.Height == 180)            {                this.Height = 320;                btnSet.Text = "关闭配置";            }            else            {                this.Height = 180;                btnSet.Text = "打开配置";            }        }        /// <summary>        /// 登录按钮事件        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void btnLogin_Click(object sender, EventArgs e)        {            if (!string.IsNullOrEmpty(txtUserName.Text.Trim()))//判断操作员是否为空            {                if (!string.IsNullOrEmpty(txtPwd.Text.Trim()))//判断密码是否为空                {                    //passWord用来接收从数据库中读取的加密过的密码                    string passWord = TradeDAL.Stock.GetSQL_GetOperatorPwd(Convert.ToInt32(txtUserName.Text.Trim()));                    //调用CallDll程序集中的方法进行判断此操作员系信息是否在数据库中记录                    //MessageBox.Show("密码:"+passWord+"\n帐号:" + txtUserName.Text + "\n密码:" + txtPwd.Text + "\n返回结果:" + CallDll.Form1.CheckPassword1(short.Parse(txtUserName.Text.Trim()), txtPwd.Text.Trim(), passWord));                    if (CallDll.Form1.CheckPassword1(short.Parse(txtUserName.Text.Trim()), txtPwd.Text.Trim(), passWord) == 100)                    {                        PrintStockList fo = new PrintStockList();                        fo.Show();                        this.Hide();                    }                    else                    {                        MessageBox.Show("密码错误!");                    }                }                else                {                    MessageBox.Show("请输入密码!");                }            }            else            {                MessageBox.Show("请输入操作员!");            }        }        /// <summary>        /// 取消按钮事件        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void btnCancel_Click(object sender, EventArgs e)        {            this.Close();        }        /// <summary>        /// 通讯平台端口  输入        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void txtPort_KeyPress(object sender, KeyPressEventArgs e)        {            Regex reg = new Regex(@"\d");//正则判断是数字            if (!reg.IsMatch(e.KeyChar.ToString()))//判断输入的是否匹配数字                e.Handled = true;        }        /// <summary>        /// 通讯平台地址输入完毕后        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void ipBox1_Leave(object sender, EventArgs e)        {            SetConfig.SetConfigKeyValue("appSettings", "ConnIP", ipBox1.Text);        }        /// <summary>        /// 当在通讯平台端口输入完毕后        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void txtPort_Leave(object sender, EventArgs e)        {            SetConfig.SetConfigKeyValue("appSettings", "ConnPort", txtPort.Text);        }        //private byte[] GetDesSourceCode(int op_code, string password, char[] ret_code)        //{            //char[] original_data = new char[2048];            //char[] target_data = new char[2048];            //string szCmd = "";            //string source = "中华人民共和国中央人民广播电台";            //original_data = password.ToCharArray();            //long num = 0;            //for (int i = 0; i < password.Length; i++)            //{             //    szCmd            //}        //}    }}


 

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 手机速度变慢了怎么办 机械手表进水有雾气怎么办 苹果7p苹果黑屏怎么办 墨兰叶子有黑斑怎么办 孕妇吃了树莓怎么办 我想做一元夺宝怎么办 美的空调显示e6怎么办 天梭手表进水了怎么办 蚂蚁借呗关闭了怎么办 excel表分成2页怎么办 乐视视频看不了怎么办 小孩发烧到38度怎么办 1岁宝宝发烧38度怎么办 小孩发烧了怎么办如何退烧 微信朋友圈降权怎么办 新开淘宝店没生意怎么办 店铺没流量没访客怎么办 水压低热水器不打火怎么办 毛巾用久了发黄怎么办 洗完毛巾有异味怎么办 洗白衬衫发黄了怎么办 洗车高压管破了怎么办 魔力探测石没了怎么办 苹果激活码忘了怎么办 磨剪子磨换了怎么办 楼梯对着卧室门怎么办 知乎登录不上怎么办 知乎帐号被停用怎么办 把红颜知己睡了怎么办 钱串花叶子黄怎么办 招财树叶子枯萎怎么办 儿童下颌骨后缩怎么办 玻尿酸下巴太尖怎么办 碰到用假币的人怎么办 有人威胁要打我怎么办 w10电池图标没了怎么办 宽带连接不上怎么办678 宽带连接不上怎么办651 苹果4s打不开机怎么办 借贷宝逾期2天怎么办 火灾来了怎么办20字