option explicit
dim str1,str2
str1 ="order|||shiyang:100,mayang:200"
str2 = "book|||shuming:计算机,dingjia:100"
'声明2个全局对象
'放弃了一开始希望用数组存储的方式,那个虽然效率更高,但是需要自定义的array_pushobj函数,所以此处不做讨论了
dim objname_g
dim classname_g
'返回实体类
function getObjmod(byval str)
dim classname,itemlist,i
dim execstr
classname = split(str,"|||")(0)
execstr = "class "&classname&chr(10)
itemlist = split(split(str,"|||")(1),",")
for i = 0 to ubound(itemlist)
execstr = execstr +"public "&split(itemlist(i),":")(0)&chr(13)&chr(10)
next
execstr = execstr&"end class"&chr(13)&chr(10)&_
" set objname_g = new "&classname
classname_g =classname
execute execstr
end function
'赋值
function getobjcon(byval str)
dim itemlist,i,execstr
if classname_g = split(str,"|||")(0) and isobject(objname_g) then
set getobjcon = objname_g
else
getObjmod( str)
set getobjcon = objname_g
end if
itemlist = split(split(str,"|||")(1),",")
for i = 0 to ubound(itemlist)
execstr = execstr +"getobjcon."&split(itemlist(i),":")(0)&" = """&split(itemlist(i),":")(1)&"""" &chr(13)&chr(10)
next
execute execstr
end function
'测试函数
sub ceshi3
dim i,o1
for i = 0 to 10000
set o1 = getobjcon(str1)
response.write o1.shiyang&"<br>"
next
set o1 = getobjcon(str2)
response.write o1.shuming&"<br>"
end sub
dim t1
t1=timer()
call ceshi3
response.write FormatNumber((timer()-t1),4,-1)
ASP(Active Server Pages)是Microsoft很早就推出的一种WEB应用程序解决方案,也是绝大多数从事网站开发人员很熟悉的一个比较简单的编程环境。通过ASP我们可以创建功能强大的动态的WEB应用程序。ASP虽然功能很强大,但有些功能用纯ASP代码完成不了,为了能保证开发出功能更加强大的WEB应用程序,我们可以借助调用COM组件。 ......
目前在Internet上广泛使用的后台技术种类繁多,应用比较广泛的有CGI,ASP,PHP,JSP/JavaServlet,ColdFusion等。在这一节里,主要介绍几种在国内应用比较广泛的后台语言。
CGI,全称为Common Gateway Interface
CGI就是公共网关接口 (Common Gateway Interface) 的缩写。它是最早被用来建立动态网站的后台技术 ......