Asp常用通用函数之Cookie防乱码
'函数名:CodeCookie
'作 用:Cookie防乱码写入时用
'参 数:str ---- 字符串
'返回值:整理后的字符串
'示 例:
'**************************************************
Public Function CodeCookie(str)
If isNumeric(str) Then str=Cstr(str)
Dim newstr
newstr=""
For i=1 To Len(str)
newstr=newstr & ascw(mid(str,i,1))
If i<> Len(str) Then newstr= newstr & "a"
Next
CodeCookie=newstr
End Function
'**************************************************
'函数名:DecodeCookie
'作 用:Cookie防乱码读出时用
'参 数:str ---- 字符串
'返回值:整理后的字符串
'示 例:
'**************************************************
Public Function DecodeCookie(str)
DecodeCookie=""
Dim newstr
newstr=Split(str,"a")
For i = LBound(newstr) To UBound(newstr)
DecodeCookie= DecodeCookie & chrw(newstr(i))
Next
End Function
相关文档:
ASP程序的特点
编写ASP程序由 Javascript 或 VBscript 结合 HTML 代码来实现。
常用编写工具有记事本,Frontpage 和 Dreamweaver 。
ASP 代码不会被传输到客户端的浏览器上,这有助于保护源代码,以免泄漏。
ASP标记的用法
方式1:将脚本语言编入<% %> 中,可以和 HTML 语言混合使用。
......
http://fjtysgzx.hpw-js.com/Photo-151469.aspx) <%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Net"%>
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD ......
Active Server Pages 提供内建对象,这些对象使用户更容易收集通过浏览器请求发送的信息、响应浏览器以及存储用户信息(如用户首选项)。本文简要说明每一个对象。
Application 对象
可以使用 Application 对象使给定应用程序的所有用户共享信息。
Request 对象
可以使用 Request 对象访问任何用 HTTP 请求 ......
<% '--------------------------------------------------------------------------------------------------
Set rs9 = Server.CreateObject("ADODB.RecordSet")
sqlstr="select * from 客户资料库 order by id desc"
rs9.open sqlstr,conn,1,3
%>
<%Set fs = server.CreateObject( ......