摘要:
/// <summary> /// 检测是否不带恶意字符 /// </summary> /// <param name="InText"></param> /// <returns>如果参数存在不安全字符,则返回true</returns> public static bool SqlFilter(string InText) { string word = "and|exec|insert|select|delete|update|master|or|truncate|declare|.&q 阅读全文
摘要:
private string GetImg(string str) { string res = ""; string tem = ""; int startIndex = 0; int endIndex = 0; for (int i = 0; i < str.Length - 3; i++) { tem = str.Substring(i, 3).ToLower(); if (tem == "src") { startIndex = i; str = str.Substring(startIndex+5); endIndex 阅读全文
摘要:
1:第一种方式:用DatatableBuyPro(1, Request.QueryString["id"].ToString());public string BuyPro(int number, string ProductCode) {if (Session["Cart"] == null) { this.BuildCart(number, ProductCode); } else { DataTable cart = Session["Cart"] as DataTable; if (this.Existproduct(cart 阅读全文
摘要:
public class PageNums{ /// </summary> /// <param name="ds">DataSet实例</param> /// <param name="datalistname">DataList名称</param> /// <param name="pagesize">分页大小</param> public static string GetPageNum(DataTable ds, DataList datali 阅读全文
摘要:
存储过程1create PROCEDURE gettotalnums(@TableNames NVARCHAR(200),@Filter nvarchar(200))AS IF @Filter = '' SET @Filter = ' WHERE 1=1' ELSE SET @Filter = ' WHERE ' + @Filter EXECUTE('select count(*) from '+@TableNames+' '+@Filter)存储过程2create PROCEDURE [fenye]@TableN 阅读全文
摘要:
delete from Userinfo where userid in (select userid from Userinfo group by userid having count(userid) > 1)and uid not in (select min(uid) from Userinfo group by userid having count(userid )>1) 阅读全文
摘要:
本人所了解有两种方案,可能还有其的方式,希望大家多多讨论! 基本思路:1. 域名支持泛解析,即是指:把A记录 *.域名.com 解析到服务器IP,服务器IIS中做绑定,绑定时主机头为空;2. 为了实现完全的二级域,建两个站点,一个为主站用,一个为用户用,两个站点目录都指到一个同一网站目录3. 在Web程序中或取URL来源中的二级域名主机头,比如:abc.域名.com 中的 abc;4. 用获取来的二级域名名称,存入Session,方便取用5. 用获取来的二级域名名称,用URL重写地址 实现方法:域名A记录解析不用说了吧 ^_^,就是做一个*.域名.com的A记录解析到你服务器IP方法一:二级域 阅读全文
摘要:
1:获得IE版本<script type="text/javascript">var ua=navigator.userAgent.toLowerCase();var IEVer= /msie/.test(ua)?parseFloat(ua.match(/msie ([\d.]+)/)[1]):false;if(IEVer==6){}</script> 2:GridView1设置主键GridView1.DataKeyNames = new string[] { "id"};//设置主键(这一句最好放在GridView1.DataB 阅读全文
摘要:
asp:FileUpload ID="FileUpload1" runat="server" /><asp:Button ID="btnaddd" runat="server" Text="上传" OnClick="btnaddd_Click" /><div id="zyc"></div><asp:Label ID="lb" runat="server" Text=&q 阅读全文