模仿csdn的代码,己整理的Linux常用命令(4)
height: 230px; float: left;
list-style: none;
}
#wrap ul{
position: absolute; left: 0; top: 0;
}
#wrap{
width: 1520px; height: 230px;
margin: 100px 50px; position: relative; background: red; overflow: hidden;
}
[代码] 获取的参数 //获取的参数
function getParam(paramKey){ //获取当前
var = location.href; //获取要取得的get参数位置
var get = .indexOf(paramKey +\ if(get == -1){
return false; }
//截取字符串
var getParamStr = .slice(paramKey.length + get + 1); //判断截取后的字符串是否还有其他get参数 var nextparam = getParamStr.indexOf(\ if(nextparam != -1){
getParamStr = getParamStr.slice(0, nextparam); }
return decodeURIComponent(getParamStr); }
[代码] 添加参数 //添加参数
function addParam(,paramKey,paramVal){ var andStr = \
var beforeparam = .indexOf(\ if(beforeparam != -1){ andStr = \ }
return + andStr + paramKey + \}
[代码] 删除参数 //删除参数
function delParam(,paramKey){
var Param = .substr(.indexOf(\ var before = .substr(0,.indexOf(\ var next = \
var arr = new Array(); if(Param!=\
var ParamArr = Param.split(\
for(var i=0;i var paramArr = ParamArr[i].split(\ if(paramArr[0]!=paramKey){ arr.push(ParamArr[i]); } } } if(arr.length>0){ next = \ } = before+next; return ; } [代码] [C#]代码 #region 防止sql注入式攻击(可用于UI层控制) /// /// 判断字符串中是否有SQL攻击代码 /// /// 传入用户提交数据 /// true-安全;false-有注入攻击现有; public bool ProcessSqlStr(string inputString) { string SqlStr = @\r|char|asc|mid|substring|master|truncate|declare|xp_cmdshell|restore|backup|net +user|net +localgroup +administrators\ try { if ((inputString != null) && (inputString != String.Empty)) { string str_Regex = @\ Regex Regex = new Regex(str_Regex, RegexOptions.IgnoreCase); //string s = Regex.Match(inputString).Value; if (true == Regex.IsMatch(inputString)) return false; } } catch { return false; } return true; } /// /// 处理用户提交的请求,校验sql注入式攻击,在页面装置时候运行 /// System.Configuration.ConfigurationSettings.AppSettings[\为用户自定义错误页面提示地址, /// 在Web.Config文件时里面添加一个 ErrorPage 即可 /// /// /// public void ProcessRequest() { try { string getkeys = \ string sqlErrorPage = System.Configuration.ConfigurationSettings.AppSettings[\ if (System.Web.HttpContext.Current.Request.QueryString != null) { for (int i = 0; i < System.Web.HttpContext.Current.Request.QueryString.Count; i++) { getkeys = System.Web.HttpContext.Current.Request.QueryString.Keys[i]; if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.QueryString[getkeys])) { System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage + \getkeys + \有SQL攻击嫌疑!\ System.Web.HttpContext.Current.Response.End(); } } } if (System.Web.HttpContext.Current.Request.Form != null) { for (int i = 0; i < System.Web.HttpContext.Current.Request.Form.Count; i++) { getkeys = System.Web.HttpContext.Current.Request.Form.Keys[i]; if (!ProcessSqlStr(System.Web.HttpContext.Current.Request.Form[getkeys])) { System.Web.HttpContext.Current.Response.Redirect(sqlErrorPage + \getkeys + \有SQL攻击嫌疑!\ System.Web.HttpContext.Current.Response.End(); } } } } catch { // 错误处理: 处理用户提交信息! } } #endregion #region 转换sql代码(也防止sql注入式攻击,可以用于业务逻辑层,但要求UI层输入数据时候进行解码) /// /// 提取字符固定长度 /// /// /// /// public string CheckStringLength(string inputString, Int32 maxLength) { if ((inputString != null) && (inputString != String.Empty)) { inputString = inputString.Trim(); if (inputString.Length > maxLength) inputString = inputString.Substring(0, maxLength); } return inputString; } /// /// 将输入字符串中的sql敏感字,替换成\敏感字]\,要求输出时,替换回来 /// /// /// qhd001.com public string MyEncodeInputString(string inputString) {
相关推荐:
- [政务民生]2013年公共基础知识热点问题(七)
- [政务民生]检验检测机构资质认定评审准则及释义20
- [政务民生]关于印发重庆市房屋建筑和市政基础设施
- [政务民生]1、隧道洞身开挖支护施工技术交底书
- [政务民生]2015年山东省17地市中考语文试题分类汇
- [政务民生]2-高级会计师资格考试和评审流程图
- [政务民生]2018版中国清分机行业发展分析及前景策
- [政务民生]新课改高中政治探究
- [政务民生]2018-2024年中国新型组合房屋行业投资
- [政务民生]2015年上海市春季高考数学模拟试卷五
- [政务民生]灌砂法及环刀法测压实度(带计算过程)
- [政务民生]运筹学实验2求解非线性规划
- [政务民生]劝学、逍遥游默写(教师卷)
- [政务民生]《运筹学》 - 期末考试 - 试卷A - 答案
- [政务民生]八年级英语下册 Module 6 Hobbies测试
- [政务民生]2019年宪法知识竞赛试题库100题(含答
- [政务民生]自动化英文文献翻译
- [政务民生]公文格式实施细则
- [政务民生]高一地理上册课堂跟踪练习题6
- [政务民生]会计继续教育习题及答案
- 第三章 无约束最优化方法
- 泛读教程第三册答案
- 魏晋南北朝文学
- 幂的运算复习题
- 城市环境问题的成因与治理策略_以社会
- 钢结构行业产业链及竞争分析研究
- 新型热塑性弹性体增韧聚丙烯的研究
- 中国旅游地理B卷试题及答案
- (苏教版)五年级数学上册第三单元测试卷
- 不稳定性心绞痛诊断与治疗
- 俞氏国际后勤职能部门绩效考核办法
- GB7258-2017新标准考试题含答案
- 小学生汉字听写比赛活动方案
- 1.3《平抛运动》学案 教科版必修2
- 2011香港特别行政区公务员考试复习资料
- 考虑水力条件变化的城市给水管网可靠性
- 表面活性剂在油田开发和生产中的应用
- ITT内部培训资料-FI端吸泵的介绍
- 文明守纪,从我做起学生发言稿
- 初中读《聊斋志异》心得体会800字范文




