电脑技术
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript 无缝八向滚动(兼容ie/ff)</title>
</head>
<body>
<script type="text/javascript">
var $ = function (id) {
return "string" == typeof id ? document.getElementById(id) : id;
};
var Class = {
create: function() {
return function() {
this.initialize.apply(this, arguments);
}
}
}
Object.extend = function(destination, source) {
for (var property in source) {
destination[property] = source[property];
}
return destination;
}
function addEventHandler(oTarget, sEventType, fnHandler) {
if (oTarget.addEventListener) {
oTarget.addEventListener(sEventType, fnHandler, false);
} else if (oTarget.attachEvent) {
oTarget.attachEvent("on" + sEventType, fnHandler);
} else {
oTarget["on" + sEventType] = fnHandler;
}
};
var Scroller = Class.create();
Scroller.prototype = {
initialize: function(idScroller, idScrollMid, options) {
var oScroll = this, oScroller = $(idScroller), oScrollMid = $(idScrollMid);
this.SetOptions(options);
this.scroller = oScroller; //对象
this.timer = null; //时间
this.Side = []; //方向
this.side = 0; //参数
//方向设置
switch (this.options.Side.toLowerCase()) {
case "right-down" :
this.Side = ["right", "down"];
break;
case "right-up" :
this.Side = ["right", "up"];
break;
case "left-down" :
this.Side = ["left", "down"];
break;
case "left-up" :
this.Side = ["left", "up"];
break;
case "right" :
this.Side = ["right"];
break;
case "left" :
this.Side = ["left"];
break;
case "down" :
this.Side = ["down"];
break;
case "up" :
default :
this.Side = ["up"];
}
//用于上下滚动
this.heightScroller = parseInt(oScroller.style.height) || oScroller.offsetHeight;
this.heightList = oScrollMid.offsetHeight;
//用于左右滚动
this.widthScroller = parseInt(oScroller.style.width) || oScroller.offsetWidth;
this.widthList = oScrollMid.offsetWidth;
//js取不到css设置的height和width
oScroller.style.overflow = "hidden";
oScrollMid.appendChild(oScrollMid.cloneNode(true));
oScrollMid.appendChild(oScrollMid.cloneNode(true));
addEventHandler(oScroller, "mouseover", function() { oScroll.Stop(); });
addEventHandler(oScroller, "mouseout", function() { oScroll.Start(); });
this.Start();
},
//设置默认属性
SetOptions: function(options) {
this.options = {//默认值
Step: 1,//每次变化的px量
Speed: 20,//速度(越大越慢)
Side: "up"//滚动方向:"up"是上,"down"是下,"left"是左,"right"是右
};
Object.extend(this.options, options || {});
},
//上下滚动
ScrollUpDown: function() {
this.scroller.scrollTop = this.GetScroll(this.scroller.scrollTop, this.heightScroller, this.heightList);
var oThis = this;
this.timer = window.setTimeout(function(){ oThis.Start(); }, this.options.Speed);
},
//左右滚动
ScrollLeftRight: function() {
//注意:scrollLeft超过1400会自动变回1400 注意长度
this.scroller.scrollLeft = this.GetScroll(this.scroller.scrollLeft, this.widthScroller, this.widthList);
var oThis = this;
this.timer = window.setTimeout(function(){ oThis.Start(); }, this.options.Speed);
},
//获取设置滚动数据
GetScroll: function(iScroll, iScroller, iList) {
if(this.side > 0){
if(iScroll >= (iList * 2 - iScroller)){ iScroll -= iList; }
} else {
if(iScroll <= 0){ iScroll += iList; }
}
return (iScroll + this.options.Step * this.side);
},
//开始
Start: function() {
this.Side.push(this.Side.shift().toLowerCase());
//document.getElementById("test").innerHTML+=s+",";
//方向设置
switch (this.Side[0].toLowerCase()) {
case "right" :
if(this.widthList < this.widthScroller) return;
this.side = -1;
this.ScrollLeftRight();
break;
case "left" :
if(this.widthList < this.widthScroller) return;
this.side = 1;
this.ScrollLeftRight();
break;
case "down" :
if(this.heightList < this.heightScroller) return;
this.side = -1;
this.ScrollUpDown();
break;
case "up" :
default :
if(this.heightList < this.heightScroller) return;
this.side = 1;
this.ScrollUpDown();
}
},
//停止
Stop: function() {
clearTimeout(this.timer);
}
};
window.onload = function(){
new Scroller("idScroller", "idScrollMid",{ Side:"left-down" });
new Scroller("idScroller1", "idScrollMid1",{ Side:"left-up" });
new Scroller("idScroller2", "idScrollMid2",{ Side:"right-down" });
new Scroller("idScroller3", "idScrollMid3",{ Side:"right-up" });
new Scroller("idScroller4", "idScrollMid4",{ Side:"left-up" });
new Scroller("idScroller5", "idScrollMid5",{ Side:"right-up" });
new Scroller("idScroller6", "idScrollMid6",{ Side:"left-down" });
new Scroller("idScroller7", "idScrollMid7",{ Side:"right-down" });
new Scroller("idScroller8", "idScrollMid8",{ Side:"right-down" });
new Scroller("idScroller9", "idScrollMid9",{ Side:"left-down" });
new Scroller("idScroller10", "idScrollMid10",{ Side:"right-up" });
new Scroller("idScroller11", "idScrollMid11",{ Side:"left-up" });
}
</script>
<style>
*{}{margin:0px; padding:0px;}
.Scroller {}{line-height:50px;overflow:hidden; border:1px solid #000000;}
.ScrollMid {}{float:left;}
.ScrollMid ul{}{width:250px;float:left;overflow:hidden;}
.ScrollMid li{}{list-style:none;}
.Scroller2 {}{overflow:hidden;float:left;}
.ScrollMid2 {}{float:left;}
.ScrollMid2 ul{}{width:100px;height:100px;float:left;overflow:hidden;}
.ScrollMid2 li{}{list-style:none; width:100px; height:100px;}
</style>
<div id="idScroller" class="Scroller" style="width:250px; height:50px;">
<div style="width:500px">
<div id="idScrollMid" class="ScrollMid">
<ul>
<li> <a href="http://35sou.com/">1111111111111111111111</a></li>
</ul>
</div>
</div>
</div>
<br />
<br />
<div id="idScroller1" class="Scroller" style="width:250px; height:50px;">
<div style="width:500px">
<div id="idScrollMid1" class="ScrollMid">
<ul>
<li> <a href="http://35sou.com/">1111111111111111111111</a></li>
</ul>
</div>
</div>
</div>
<br />
<br />
<div id="idScroller2" class="Scroller" style="width:250px; height:50px;">
<div style="width:500px">
<div id="idScrollMid2" class="ScrollMid">
<ul>
<li> <a href="http://35sou.com/">1111111111111111111111</a></li>
</ul>
</div>
</div>
</div>
<br />
<br />
<div id="idScroller3" class="Scroller" style="width:250px; height:50px;">
<div style="width:500px">
<div id="idScrollMid3" class="ScrollMid">
<ul>
<li> <a href="http://35sou.com/">1111111111111111111111</a></li>
</ul>
</div>
</div>
</div>
<br /><br />
<div style="width:200px;">
<div id="idScroller4" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid4" class="ScrollMid2">
<ul>
<li style="background:url(1.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller5" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid5" class="ScrollMid2">
<ul>
<li style="background:url(2.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller6" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid6" class="ScrollMid2">
<ul>
<li style="background:url(2.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller7" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid7" class="ScrollMid2">
<ul>
<li style="background:url(1.gif);"> </li>
</ul>
</div>
</div>
</div>
</div>
<br /><br />
<div style="width:200px;">
<div id="idScroller8" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid8" class="ScrollMid2">
<ul>
<li style="background:url(2.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller9" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid9" class="ScrollMid2">
<ul>
<li style="background:url(1.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller10" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid10" class="ScrollMid2">
<ul>
<li style="background:url(1.gif);"> </li>
</ul>
</div>
</div>
</div>
<div id="idScroller11" class="Scroller2" style="width:100px; height:100px;">
<div style="width:200px">
<div id="idScrollMid11" class="ScrollMid2">
<ul>
<li style="background:url(2.gif);"> </li>
</ul>
</div>
</div>
</div>
</div>
<div id="test"></div>
</body>
</html>
在我们设计网页的时候,总会遇到一些不愉快的事情,最常见的莫过于在后台添加内容后才发现显示的页面被撑开,导致网页极度不美观。以前大家基本上都是设计表格,网上自然不少对于的解决方法,如今还有div+css标准设计,很少看到相关好的方法,现在潇湘在线把平时找到的防止表格被撑开的好方法总结归纳一下,和大家一起分享。
一、直接在网页里设置图片大小,比如代码:
二、使用如下代码:
这种方法会在调用图片的时候,自动按比例缩小到指定的宽度,不会引起图片的变形,并且也不会撑破表格,但是缺点是,如果图片太大,在图片下载过程中,也就是图片显示过程中,会先以图片原大小显示,这时就会撑破表格,页面很难看,二当图片完全显示后,图片又会自动缩小。
三、我们可以针对表格的属性来限制大小防止被撑开,比如在
四、用css控制图片自适应大小,代码如:
五、最后总结一下最实用的代码:
如果是表格,请用:
一、直接在网页里设置图片大小,比如代码:
<img src="http://www.krjpg.cn/www.xxol.net.jpg" width="600" height="500" border="0">
,这样虽然可以限制了图片大小,但是需要在上传图片之前手动修改图片大小,否则上传的图片就会变形。二、使用如下代码:
<img src="http://www.krjpg.cn/www.xxol.net.jpg" onload="javascript:if(this.width>600}{this.resized=true;this.style.width=600;}">
这种方法会在调用图片的时候,自动按比例缩小到指定的宽度,不会引起图片的变形,并且也不会撑破表格,但是缺点是,如果图片太大,在图片下载过程中,也就是图片显示过程中,会先以图片原大小显示,这时就会撑破表格,页面很难看,二当图片完全显示后,图片又会自动缩小。
三、我们可以针对表格的属性来限制大小防止被撑开,比如在
<table width="600" border="0" cellpadding="0" cellspacing="0">
里添加代码“style="table-layout:fixed;word-wrap:break-word;word-break;break-all;"
”,其中“table-layout:fixed; ”是为了将表格布局固定住,就可以有效地防止表格被撑开,“word-wrap:break-word;
”是控制换行的,也就是强制执行换行,这个在文本内容较多的情况下需要使用到,特别是重复的内容出现,不执行换行的话,表格就被撑开了;而“word-break: break-all; ”可以解决IE的框架被英文(非亚洲语言文本行)撑开的问题,但是不会强制换行,只显示表格宽度里的内容。一般情况下只要用到“style="table-layout:fixed;word-wrap:break-word;"
就可以。当然,上面调用的语句可以定义在css里,比如table {
table-layout: fixed;
word-wrap:break-word;
}
table-layout: fixed;
word-wrap:break-word;
}
四、用css控制图片自适应大小,代码如:
img {
max-width: 600px;
width:expression(this.width > 600 ? "600px" : this.width);
overflow:hidden;
}
其中 max-width:600px; 在IE7、FireFox等其他非IE浏览器下最大宽度为600px,但在IE6中无效;width:600px; 在所有浏览器中图片的大小为600px,当图片大小大于600px,自动缩小为600px,在IE6中有效;而 overflow:hidden; 指将超出设置大小的部分隐藏,避免控制图片大小失败而引起的表格撑开变形。max-width: 600px;
width:expression(this.width > 600 ? "600px" : this.width);
overflow:hidden;
}
五、最后总结一下最实用的代码:
如果是表格,请用:
table {
table-layout: fixed;
word-break: break-all;
}
如果是div层,请用:table-layout: fixed;
word-break: break-all;
}
div {
table-layout: fixed;
word-wrap: break-word;
width: 加上宽度;
overflow: hidden; (让多出来的不显示。)
}
table-layout: fixed;
word-wrap: break-word;
width: 加上宽度;
overflow: hidden; (让多出来的不显示。)
}
HP CQ35/CQ40/CQ60/CQ61/dv3/dv4/dv5/dv6全系列本本 SLIC2.1 BIOS分享
对于DV4、CQ45等机型,HP官网撤掉了F42版本BIOS,到驱动之家下载即可,SP43868。
如果你不知道你的CQ/DV本本应该使用哪个FD文件刷新,你下载回来的官方SP BIOS刷新文件中也有不止一个FD文件,那么你这样操作(这也是替换刷新的方法)——
1. 到官方网站或者驱动之家下载新版SP BIOS刷新文件,双击运行,等出现insyde的刷新界面后,不要点开始,也不要关闭;

2. 打开电脑系统盘program files/spxxxxx目录(也有部分是解压在系统盘根目录下swsetup文件夹,自己找),打开里面的 platform.ini,查看其中如下图中红框位置所示的FD文件名(图片中是以dv4刷新为例,看你自己的是多少),这个就是你要刷的FD文件,按照它的名字下载相应的修改好的FD文件,替换掉此目录中的相应FD文件,回到刷新界面继续刷新即可。

改好的SLIC2.1 BIOS下载地址,打开根据自己的 FD文件名找相应的下载(根据SP和FD文件名确定,文件说明中的机型仅作参考):
下载:http://www.uushare.com/user/lovegl/files/1856349
完毕电脑自动关机,稍等几分钟再开机。在WIN7(x86)下用SLIC_DUMP_Tools查看是否已经更新为SLIC2.1(x64系统安装RW-Everything) ,如果仍然是SLIC2.0,找个PE启动,在PE下用SLIC_DUMP_tools 1.03查看是否SLIC2.1。如果在PE下查看是SLIC2.1,而在WIN7下看到的是SLIC2.0,格式化引导区所在分区重装系统即可。
注意:刷新BIOS有风险,虽然这些FD文件都不止一个人刷新成功了,但并不能保证你百分之百的不出问题,刷新过程中最好装上电池插好交流电并保证刷新过程不会被非正常中断。
刷BIOS的一切后果由刷机人自己承担,如果不同意请勿下载刷新,谢谢合作。
对于DV4、CQ45等机型,HP官网撤掉了F42版本BIOS,到驱动之家下载即可,SP43868。
如果你不知道你的CQ/DV本本应该使用哪个FD文件刷新,你下载回来的官方SP BIOS刷新文件中也有不止一个FD文件,那么你这样操作(这也是替换刷新的方法)——
1. 到官方网站或者驱动之家下载新版SP BIOS刷新文件,双击运行,等出现insyde的刷新界面后,不要点开始,也不要关闭;
2. 打开电脑系统盘program files/spxxxxx目录(也有部分是解压在系统盘根目录下swsetup文件夹,自己找),打开里面的 platform.ini,查看其中如下图中红框位置所示的FD文件名(图片中是以dv4刷新为例,看你自己的是多少),这个就是你要刷的FD文件,按照它的名字下载相应的修改好的FD文件,替换掉此目录中的相应FD文件,回到刷新界面继续刷新即可。
改好的SLIC2.1 BIOS下载地址,打开根据自己的 FD文件名找相应的下载(根据SP和FD文件名确定,文件说明中的机型仅作参考):
下载:http://www.uushare.com/user/lovegl/files/1856349
完毕电脑自动关机,稍等几分钟再开机。在WIN7(x86)下用SLIC_DUMP_Tools查看是否已经更新为SLIC2.1(x64系统安装RW-Everything) ,如果仍然是SLIC2.0,找个PE启动,在PE下用SLIC_DUMP_tools 1.03查看是否SLIC2.1。如果在PE下查看是SLIC2.1,而在WIN7下看到的是SLIC2.0,格式化引导区所在分区重装系统即可。
注意:刷新BIOS有风险,虽然这些FD文件都不止一个人刷新成功了,但并不能保证你百分之百的不出问题,刷新过程中最好装上电池插好交流电并保证刷新过程不会被非正常中断。
刷BIOS的一切后果由刷机人自己承担,如果不同意请勿下载刷新,谢谢合作。
前几日发了一篇数据库sql被挂马终极批量删除木马方法,虽然也可以起到批量删除木马的作用,但是如果被挂马字段特别多的话还是比较麻烦的。今天无意中在网上找到了一个高人写的asp批量删除木马的程序,功能很强大,你只需要把你的服务器IP、数据库名、用户名、密码和被挂马的字段填写上去,而后点击提交就可以批量清楚木马了,是不是迫不及待了。
用法:新建一个asp文件比如sql.asp,把上边代码复制进去上传到你的服务器空间里边,然后运行http://你的域名/sql.asp。填写参数开始查杀,是不是很方便。就是界面有点丑陋,你可以查看相关的css手册来美化一下收藏备用。
源文件:
<%Server.ScriptTimeout=999999999
Response.Buffer =true%>
<title>sql数据库清木马_100天网页设计网</title>
</head>
<style>
td{font-size:12px;}
.div{ border:1px #CCCCCC solid; padding:3px; margin:10px;}
.span{ height:20px; background-color:#CCCCCC; padding:3px;}
</style>
<body>
<p>
<%
if request.Form<>"" then
connstr="PROVIDER=SQLOLEDB;DATA SOURCE="&request("ip")";DATABASE="&request("database")";UID="&request("uname")";PWD="&request("pwd")""
'connstr=conn
set conn=server.CreateObject("adodb.Connection")
conn.open connstr
badstr=request("badstr")
select case request("type")
case "56"
str="int"
case "175"
str="char"
case "167"
str="varchar"
case "35"
str="text"
case "239"
str="nchar"
case "231"
str="nvarchar"
case "99"
str="ntext"
end select
select case request("bigclass")
case "char"
response.Write("<br><br><b>全部字符型字段:</b><br><br>")
set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
do while not rs.eof
conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"]=replace(["&rs("Column_name")"],'"&badstr"','')")
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")") </span>")
rs.movenext
loop
end if
rs.close
set rs=nothing
case "text"
response.Write("<br><br><b>全部ntext字段:</b><br><br>")
set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
do while not rs.eof
'conn.execute("update ["&rs("tablename")&"] set ["&rs("Column_name")&"]=replace(["&rs("Column_name")&"],'"&badstr&"','')")
conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"] =replace(cast(["&rs("Column_name")"] as varchar(8000)),'"&badstr"','')")
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")") </span>")
rs.movenext
loop
end if
rs.close
set rs=nothing
end select
end if
%>
</p>
<%if request("ip")="" then
ip="127.0.0.1"
else
ip=request("ip")
end if
if request("datebase")="" then
datebase="dbname"
else
datebase=request("datebase")
end if
if request("uname")="" then
uname="uname"
else
uname=request("uname")
end if
if request("pwd")="" then
pwd="123456"
else
pwd=request("pwd")
end if
if request("badstr")="" then
badstr="<script src=http://3b3.org/c.js></script>"
else
badstr=request("badstr")
end if
%>
<form id="form1" name="form1" method="post" action="">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">服务ip:</td>
<td height="25"><input type="text" name="ip" style="width:200px;" value="<%=ip%>"/></td>
</tr>
<tr>
<td height="25">数据库</td>
<td height="25"><input type="text" name="datebase" style="width:200px;" value="<%=datebase%>"/></td>
</tr>
<tr>
<td height="25">用户名</td>
<td height="25"><input type="text" name="uname" style="width:200px;" value="<%=uname%>"/></td>
</tr>
<tr>
<td height="25">密码</td>
<td height="25"><input type="text" name="pwd" style="width:200px;" value="<%=pwd%>"/></td>
</tr>
<tr>
<td height="25">特征码</td>
<td height="25"><label>
<input type="text" name="badstr" style="width:500px;" value="<%=badstr%>"/>
</label></td>
</tr>
<tr>
<td width="74" height="25">选择类型</td>
<td width="526" height="25">
<select name="bigclass">
<option value="char">字符型</option>
<option value="text">文本型</option>
</select> </td>
</tr>
<tr>
<td width="74" height="25">数据类型</td>
<td width="526" height="25">
<select name="type">
<option value="175">char</option>
<option value="167">varchar</option>
<option value="35">text</option>
<option value="239">nchar</option>
<option value="231">nvarchar</option>
<option value="99">ntext</option>
</select> </td>
</tr>
<tr>
<td width="74" height="25"> </td>
<td width="526" height="25"><label>
<input type="submit" name="Submit" value="提交" />
</label></td>
</tr>
</table>
</form>
<p> </p>
<table width="307" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">字段类型</td>
<td height="20">xtype</td>
</tr>
<tr>
<td width="120" height="20">int</td>
<td width="187" height="20">56</td>
</tr>
<tr>
<td height="20">char</td>
<td height="20">175</td>
</tr>
<tr>
<td height="20">varchar</td>
<td height="20">167</td>
</tr>
<tr>
<td height="20">text</td>
<td height="20">35</td>
</tr>
<tr>
<td height="20">nchar</td>
<td height="20">239</td>
</tr>
<tr>
<td height="20">nvarchar</td>
<td height="20">231</td>
</tr>
<tr>
<td height="20">ntext</td>
<td height="20">99</td>
</tr>
</table>
<p>清楚text ntext</p>
<p> update 表名 set content =replace(cast(content as varchar(8000)),'特征码','')</p>
</body>
</html>
用法:新建一个asp文件比如sql.asp,把上边代码复制进去上传到你的服务器空间里边,然后运行http://你的域名/sql.asp。填写参数开始查杀,是不是很方便。就是界面有点丑陋,你可以查看相关的css手册来美化一下收藏备用。
源文件:
<%Server.ScriptTimeout=999999999
Response.Buffer =true%>
<title>sql数据库清木马_100天网页设计网</title>
</head>
<style>
td{font-size:12px;}
.div{ border:1px #CCCCCC solid; padding:3px; margin:10px;}
.span{ height:20px; background-color:#CCCCCC; padding:3px;}
</style>
<body>
<p>
<%
if request.Form<>"" then
connstr="PROVIDER=SQLOLEDB;DATA SOURCE="&request("ip")";DATABASE="&request("database")";UID="&request("uname")";PWD="&request("pwd")""
'connstr=conn
set conn=server.CreateObject("adodb.Connection")
conn.open connstr
badstr=request("badstr")
select case request("type")
case "56"
str="int"
case "175"
str="char"
case "167"
str="varchar"
case "35"
str="text"
case "239"
str="nchar"
case "231"
str="nvarchar"
case "99"
str="ntext"
end select
select case request("bigclass")
case "char"
response.Write("<br><br><b>全部字符型字段:</b><br><br>")
set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
do while not rs.eof
conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"]=replace(["&rs("Column_name")"],'"&badstr"','')")
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")") </span>")
rs.movenext
loop
end if
rs.close
set rs=nothing
case "text"
response.Write("<br><br><b>全部ntext字段:</b><br><br>")
set rs=conn.execute("SELECT dbo.syscolumns.name AS Column_name,dbo.sysobjects.name as tablename FROM dbo.syscolumns INNER JOIN dbo.sysobjects ON dbo.syscolumns.id = dbo.sysobjects.id WHERE dbo.sysobjects.name in (select [name] from sysobjects where xtype='U' and status <>0 and NOT (name LIKE 'dtproperties')) and dbo.syscolumns.xtype='"&request("type")"' ")
if not rs.eof then
do while not rs.eof
'conn.execute("update ["&rs("tablename")&"] set ["&rs("Column_name")&"]=replace(["&rs("Column_name")&"],'"&badstr&"','')")
conn.execute("update ["&rs("tablename")"] set ["&rs("Column_name")"] =replace(cast(["&rs("Column_name")"] as varchar(8000)),'"&badstr"','')")
response.Write("<span class=span>"&rs("Column_name")"("&rs("tablename")") </span>")
rs.movenext
loop
end if
rs.close
set rs=nothing
end select
end if
%>
</p>
<%if request("ip")="" then
ip="127.0.0.1"
else
ip=request("ip")
end if
if request("datebase")="" then
datebase="dbname"
else
datebase=request("datebase")
end if
if request("uname")="" then
uname="uname"
else
uname=request("uname")
end if
if request("pwd")="" then
pwd="123456"
else
pwd=request("pwd")
end if
if request("badstr")="" then
badstr="<script src=http://3b3.org/c.js></script>"
else
badstr=request("badstr")
end if
%>
<form id="form1" name="form1" method="post" action="">
<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">服务ip:</td>
<td height="25"><input type="text" name="ip" style="width:200px;" value="<%=ip%>"/></td>
</tr>
<tr>
<td height="25">数据库</td>
<td height="25"><input type="text" name="datebase" style="width:200px;" value="<%=datebase%>"/></td>
</tr>
<tr>
<td height="25">用户名</td>
<td height="25"><input type="text" name="uname" style="width:200px;" value="<%=uname%>"/></td>
</tr>
<tr>
<td height="25">密码</td>
<td height="25"><input type="text" name="pwd" style="width:200px;" value="<%=pwd%>"/></td>
</tr>
<tr>
<td height="25">特征码</td>
<td height="25"><label>
<input type="text" name="badstr" style="width:500px;" value="<%=badstr%>"/>
</label></td>
</tr>
<tr>
<td width="74" height="25">选择类型</td>
<td width="526" height="25">
<select name="bigclass">
<option value="char">字符型</option>
<option value="text">文本型</option>
</select> </td>
</tr>
<tr>
<td width="74" height="25">数据类型</td>
<td width="526" height="25">
<select name="type">
<option value="175">char</option>
<option value="167">varchar</option>
<option value="35">text</option>
<option value="239">nchar</option>
<option value="231">nvarchar</option>
<option value="99">ntext</option>
</select> </td>
</tr>
<tr>
<td width="74" height="25"> </td>
<td width="526" height="25"><label>
<input type="submit" name="Submit" value="提交" />
</label></td>
</tr>
</table>
</form>
<p> </p>
<table width="307" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="20">字段类型</td>
<td height="20">xtype</td>
</tr>
<tr>
<td width="120" height="20">int</td>
<td width="187" height="20">56</td>
</tr>
<tr>
<td height="20">char</td>
<td height="20">175</td>
</tr>
<tr>
<td height="20">varchar</td>
<td height="20">167</td>
</tr>
<tr>
<td height="20">text</td>
<td height="20">35</td>
</tr>
<tr>
<td height="20">nchar</td>
<td height="20">239</td>
</tr>
<tr>
<td height="20">nvarchar</td>
<td height="20">231</td>
</tr>
<tr>
<td height="20">ntext</td>
<td height="20">99</td>
</tr>
</table>
<p>清楚text ntext</p>
<p> update 表名 set content =replace(cast(content as varchar(8000)),'特征码','')</p>
</body>
</html>






