1.vbs
Function asfman_BytesToStr(Body,cset)
Dim ADOS
Set ADOS=Server.CreateObject("ADODB.Stream")
With ADOS
.Type=1 '1means bytes 2means text
.Mode=3 'in fact,it mustn't been set
.Open
.Write Body
.Position=0 ' move the position to the head
.Type=2
.CharSet=cset
asfman_BytesToStr=.ReadText
.Close
End with
Set ADOS=nothing
End Function
2.use append and appendchunk
function asfman(html) {
var rs=new ActiveXObject("ADODB.Recordset");
rs.Fields.Append("asfman",201,1);
rs.Open();
rs.AddNew();
rs.fields.item(0).AppendChunk(html);
rs.Update();
temp=rs(0).value;
rs.Close();
delete rs;
return temp;
}
3.cookie 解码
<script language=Vbscript>
Function vbChar(str)
vbChar=Chr(str)
End Function
</script>
<script language=Javascript>
var glbEncode=new Array();
function reCode(str) {
var str=str.replace(/%([A-Z].)%(.{2}))/g,"@$1$2";
var t=str.split("@"),k,l=t.length;
for(var i=0;i<l;i++) {
k=t[i].substring(0,4);
if(!glbEncode[k])
glbEncode[k]=escape(vbChar(eval("0x"+k)));
t[i]=glbEncode[k]+t[i].substring(4);
}
str=unescape(t.join(""));
return str.match(/%([A-Z].)%(.{2})/g)?reCode(str):str.replace(/\+/g," ");
}
</script>
posted on 2006-10-12 14:56
汪杰 阅读(504)
评论(0) 编辑 收藏 引用 所属分类:
ajax