示例#1
0
文件: Fetch.cs 项目: zhitops/TypeSDK
        /// <summary>
        /// 获取验证码数值
        /// </summary>
        /// <returns></returns>
        public static string GetVerifyCode()
        {
            string vcode = "";

            if (HttpContext.Current != null && HttpContext.Current.Session != null)
            {
                vcode = SessionState.Get(Fetch.UC_VERIFY_CODE_KEY) as string;
                //Session 保存,无需解密
                if (!string.IsNullOrEmpty(vcode))
                {
                    return(vcode);
                }
            }
            else
            {
                vcode = Utility.GetCookie(Fetch.UC_VERIFY_CODE_KEY);
            }

            if (!String.IsNullOrEmpty(vcode))
            {
                vcode = CWHEncryptNet.XorCrevasse(vcode);
            }

            return(vcode);
        }
        public string GetConn(int kindID)
        {
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            GameGameItem dBAddString = this.GetDBAddString(kindID);
            string       result;

            if (dBAddString == null)
            {
                result = "";
            }
            else
            {
                DataBaseInfo databaseInfo = this.GetDatabaseInfo(dBAddString.DataBaseAddr);
                if (databaseInfo == null)
                {
                    result = "";
                }
                else
                {
                    string text  = CWHEncryptNet.XorCrevasse(databaseInfo.DBUser);
                    string text2 = CWHEncryptNet.XorCrevasse(databaseInfo.DBPassword);
                    stringBuilder.AppendFormat("Data Source={0}; Initial Catalog={1}; User ID={2}; Password={3}; Pooling=true", new object[]
                    {
                        dBAddString.DataBaseAddr + (string.IsNullOrEmpty(databaseInfo.DBPort.ToString()) ? "" : ("," + databaseInfo.DBPort.ToString())),
                        dBAddString.DataBaseName,
                        text,
                        text2
                    });
                    result = stringBuilder.ToString();
                }
            }
            return(result);
        }
示例#3
0
 /// <summary>
 /// 页面加载
 /// </summary>
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         if (IntParam > 0)
         {
             DataBaseInfo dataBaseInfo = FacadeManage.aidePlatformFacade.GetDataBaseInfo(IntParam);
             if (dataBaseInfo != null)
             {
                 CtrlHelper.SetText(txtInformation, dataBaseInfo.Information.Trim());
                 CtrlHelper.SetText(txtDBAddr, dataBaseInfo.DBAddr.Trim());
                 CtrlHelper.SetText(txtDBPort, dataBaseInfo.DBPort.ToString().Trim());
                 CtrlHelper.SetText(txtDBUser, CWHEncryptNet.XorCrevasse(dataBaseInfo.DBUser.Trim()));
                 if (dataBaseInfo.DBPassword != "")
                 {
                     txtDBPassword.Attributes.Add("value", "********");
                     CtrlHelper.SetText(hdfDBPassword, dataBaseInfo.DBPassword.Trim());
                 }
                 CtrlHelper.SetText(txtMachineID, dataBaseInfo.MachineID.Trim());
             }
         }
     }
 }
        private void DataBaseDataBind()
        {
            if (StrCmd == "add")
            {
                litInfo.Text = "新增";
            }
            else
            {
                litInfo.Text = "更新";
            }

            if (IntParam <= 0)
            {
                return;
            }

            //获取站点信息
            DataBaseInfo dataBaseInfo = FacadeManage.aidePlatformFacade.GetDataBaseInfo(IntParam);

            if (dataBaseInfo == null)
            {
                ShowError("机器信息不存在");
                Redirect("DataBaseInfoList.aspx");
                return;
            }

            CtrlHelper.SetText(txtInformation, dataBaseInfo.Information.Trim());
            CtrlHelper.SetText(txtDBAddr, dataBaseInfo.DBAddr.Trim());
            CtrlHelper.SetText(txtDBPort, dataBaseInfo.DBPort.ToString().Trim());
            CtrlHelper.SetText(txtDBUser, CWHEncryptNet.XorCrevasse(dataBaseInfo.DBUser.Trim()));
            if (dataBaseInfo.DBPassword != "")
            {
                txtDBPassword.Attributes.Add("value", "********");
                CtrlHelper.SetText(hdfDBPassword, dataBaseInfo.DBPassword.Trim());
            }
            CtrlHelper.SetText(txtMachineID, dataBaseInfo.MachineID.Trim());
        }
示例#5
0
        /// <summary>
        /// 指定用户是否申请了保护
        /// </summary>
        /// <param name="strUserID"></param>
        /// <returns></returns>
        protected virtual bool IsApplyProtection(string strUserID, out AccountsProtect protectInfo)
        {
            int dwUserID = TypeParse.StrToInt(CWHEncryptNet.XorCrevasse(strUserID), 0);

            return(IsApplyProtection(dwUserID, out protectInfo));
        }
示例#6
0
文件: Fetch.cs 项目: zhitops/TypeSDK
        /// <summary>
        /// 获取用户标识
        /// </summary>
        /// <param name="strUserID"></param>
        /// <returns></returns>
        public static int GetUserID(string strUserID)
        {
            int dwUserID = TypeParse.StrToInt(CWHEncryptNet.XorCrevasse(strUserID), 0);

            return(dwUserID);
        }