Exemple #1
0
        public void fe_encode2(ref string as_logid, ref string as_psw, string as_app_name, string as_cusername, string as_ip, string as_mac, string as_hostname)
        {
            string ls_return = string.Empty;
            long   ll_pass_ts;
            bool   lb_sql = false;
            List <IDbDataParameter> outparas = new List <IDbDataParameter>();
            SqlParameter            para     = new SqlParameter("@ls_return", SqlDbType.VarChar, 2000);

            para.Direction = ParameterDirection.Output;
            outparas.Add(para);
            List <IDbDataParameter> paras = new List <IDbDataParameter>();

            para = new SqlParameter("@app", as_app_name);
            paras.Add(para);
            para = new SqlParameter("@user_win", as_cusername);
            paras.Add(para);
            para = new SqlParameter("@ip", as_ip);
            paras.Add(para);
            para = new SqlParameter("@mac", as_mac);
            paras.Add(para);
            para = new SqlParameter("@hostname", as_hostname);
            paras.Add(para);
            Dictionary <string, string> dict = DBAccess.ExecSP("mis_log_pro", paras, ref outparas);

            ls_return = dict["@ls_return"];
            lb_sql    = true;

            if (lb_sql)
            {
            }
            else
            {
                as_logid = "";;
                as_psw   = "";
                global.gu_dw1.f_msg("返回值:" + ls_return);
                return;
            }

            switch (ls_return)
            {
            case "windows":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("2你的计算机的windows登录用户名(" + as_cusername + ")在系统中没有注册!~r~n请与信息部联系!");
                return;

                break;

            case "hostname":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("3你的笔记本在系统中没有注册!~r~n请与信息部联系!");
                return;

            case "notebook":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("4你的笔记本在系统中没有注册!~r~n请与信息部联系!");
                return;

            case "computer":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("5你的计算机在系统中没有注册!~r~n请与信息部联系!");
                return;

            case "day200":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("6你的计算机或用户名在2天内登录超过200次了!~r~n请与信息部联系!");
                return;

            case "day30":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("7你的计算机或用户名在30天内错误登录超过30次了!\r~n请与信息部联系!");
                return;

            case "minute21.6":
                as_logid = "";
                as_psw   = "";
                global.gu_dw1.f_msg("8你的计算机或用户名已被锁定,请在20分钟后登录!");
                return;

            default:
                string[] strs = ls_return.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
                if (ls_return.Substring(0, 3) == "异常:")
                {
                    global.gu_dw1.f_msg("888你的计算机异常,请找信息部确认!\r\n" + ls_return);
                    return;
                }
                if (strs.Length <= 1)
                {
                    string sql = string.Format(@"
			insert into mis_log_tb1 (app,user_win,ip,mac,hostname,lrsj)
			values ('{0}' + '非法1','{1}','{2}','{3}','{4}',getdate());"            , as_app_name, as_cusername, as_ip, as_mac, as_hostname);
                    DBAccess.ExecuteSql(sql);
                    f_msg("9你的计算机在进行非法操作,请立刻停止!");
                    return;
                }
                as_logid = strs[0];
                //string str = ls_return.Substring(0, as_logid.Length + 2);
                //ls_return = ls_return.Replace(str, "");
                if (strs.Length <= 2)
                {
                    string sql = string.Format(@"
			insert into mis_log_tb1 (app,user_win,ip,mac,hostname,lrsj)
			values ('{0}' + '非法2','{1}','{2}','{3}','{4}',getdate());"            , as_app_name, as_cusername, as_ip, as_mac, as_hostname);
                    DBAccess.ExecuteSql(sql);
                    f_msg("10你的计算机在进行非法操作,请立刻停止!");
                    return;
                }
                as_psw = strs[1];
                if (ls_return.Length - as_psw.Length <= 2)
                {
                    string sql = string.Format(@"
			insert into mis_log_tb1 (app,user_win,ip,mac,hostname,lrsj)
			values ('{0}' + '非法3','{1}','{2}','{3}','{4}',getdate());"            , as_app_name, as_cusername, as_ip, as_mac, as_hostname);
                    DBAccess.ExecuteSql(sql);
                    f_msg("11你的计算机在进行非法操作,请立刻停止!");
                    return;
                }
                ls_return = strs[2];
                if (ls_return.Length != 60)
                {
                    string sql = string.Format(@"
			insert into mis_log_tb1 (app,user_win,ip,mac,hostname,lrsj)
			values ('{0}' + '非法4','{1}','{2}','{3}','{4}',getdate());"            , as_app_name, as_cusername, as_ip, as_mac, as_hostname);
                    DBAccess.ExecuteSql(sql);
                    f_msg("12你的计算机在进行非法操作,请立刻停止!");
                    return;
                }
                if (as_psw.Length != 60)
                {
                    string sql = string.Format(@"
			insert into mis_log_tb1 (app,user_win,ip,mac,hostname,lrsj)
			values ('{0}' + '非法5','{1}','{2}','{3}','{4}',getdate());"            , as_app_name, as_cusername, as_ip, as_mac, as_hostname);
                    DBAccess.ExecuteSql(sql);
                    f_msg("13你的计算机在进行非法操作,请立刻停止!");
                    return;
                }
                ls_return = global.gu_pub1.fe_wf(ls_return, global.gu_pub1.is_pswkey, false);
                as_psw    = global.gu_pub1.fe_wf(as_psw, ls_return, false);
                //global.g5_sys.connStr = string.Format(ConfigurationManager.ConnectionStrings[1].ConnectionString, as_ip, global.g5_sys., ls_loginid, ls_password);
                break;
            }
        }