Á©º¯Êý¸ã¶¨aspµÄormÓ³Éä[Ô´´]
Á©º¯Êý¸ã¶¨aspµÄormÓ³Éä
orm±ØÐëÓõ½ÊµÌåÀ࣬ÏñC#ÕâÑùµÄÓïÑÔ Ð´ÊµÌåÀàͦʹ¿àµÄ£¬³ý·ÇÓù¤¾ß
¶øaspÓиöºÃ´¦£¬ÒòΪËû¿ÉÒÔ¶¯Ì¬¹¹½¨Ò»¸ö×Ö·û´®²¢°Ñ´Ë×Ö·û´®¶¯Ì¬½âÎöΪ´úÂ룬Ҳ¾ÍÊÇËûµÄ execute ºÍ ExecuteGlobal Á©º¯Êý
ÏÂÃæÕâ¸öº¯ÊýÊÇ ÊµÌåÀàÉú³ÉÆ÷ Ö»Òª´«ÈëÁÐÃû×Ö·û´®¾ÍÄÜÉú³É Ò»¸öÈ«¾Ö¿ÉÓõÄÀà
'¶¨ÒåÒ»¸öʵÌåÀà
'clsname ×Ô¶¨ÒåÀàÃû
'cols ÁÐ×Ö·û´®¶ººÅ·Ö¸ô
sub clsnew(clsname,cols)
dim p
p = "class "&clsname&" :public "&cols&":public cols:sub class_initialize():cols="""&cols&""":end sub:sub fill(a,rownum):dim b,i:b = split(cols,"",""):for i=0 to ubound(b):execute b(i)&""=""&a(i,rownum):next:end sub: end class"
'Ò»¸ö¶¯Ì¬µÄÀà ͨ¹ý´«È붺ºÅ·Ö¸ôµÄÁÐÃû×Ö·û´® À´¶¨ÒåÀàÄÚ²¿µÄ±äÁ¿ÊôÐÔ
'ʵÌåÀàÄÚ²¿´øÓÐÒ»¸öÌî³ä×Ô¼ºµÄ·½·¨£¬Óýá¹û¼¯µÄ¶þάÊý×éÀ´Ìî³ä
ExecuteGlobal p
'È«¾ÖÖ´ÐÐÍê ÒÔºó ±¾Ò³Ãæµ½´¦¿ÉÓôËÀàÁË
end sub
'¶þάÊý×é±íת»¯ÎªÊµÌåÀàÊý×é
'clsname ˈ̞
'a ¼Ç¼¼¯µÄ¶þάÊý×é
function orm(clsname,a)
dim r(),i,o
redim r(ubound(a,2))
for i=0 to ubound(a,2)
execute "set o = new "&clsname
o.fill a,i
set r(i)=o
next
orm = r
end function
'ʹÓÃʵÀý
sub testorm
dim cols,clsname
cols = "id,bookid,type1"
clsname = "booktype"
dim a,b,i
conn_open
getrsa "select top 20 id,bookid,type type1 from book_type",a
'getrsaÊÇÖ´ÐÐsql²¢È¡µÃ½á¹ûÊý×éµÄº¯Êý
'aÊÇͨ¹ýrs.getrows»ñµÃµÄ¶þάÊý×é
conn_close
clsnew clsname,cols
b = orm(clsname,a)
for i=0 to ubound(b)
echo b(i).id&" "&b(i).bookid&" "&b(i).type1&"<br/>"
'ÕâÀïÎÒÃǾʹﵽÁËÄ¿µÄ ÔÙÒ²²»ÓÃдrs("id")ÕâÑùµÄÁË Óõã´úÌæÁËÀ¨ºÅºÍË«ÒýºÅ
next
end sub
'¸½ Ö´ÐÐsqlµÄº¯Êý
sub getrsa(sql,a)
dim rs
set rs = conn.execute(sql)
if not rs.eof then
a = rs.getrows()
else
a = ""
end if
set rs = nothing
end sub
Ïà¹ØÎĵµ£º
asp Öг£ÓõÄÎļþ´¦Àíº¯Êý ÊÕ²Ø
asp Öд¦ÀíÎļþÉÏ´«ÒÔ¼°É¾³ýʱ³£ÓõÄ×Ô¶¨Ò庯Êý
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'ËùÓÐ×Ô¶¨ÒåµÄVBSº¯Êý
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function DeleteFile(Filename) 'ɾ³ýÎļþ
&nbs ......
¡¡ 'º¯ÊýÃû£ºGetMyTimeNumber()
'×÷ ÓãºÉú³Éʱ¼äµÄÕûÊý
'²Î Êý£ºlx ---- ʱ¼äÕûÊýµÄÀàÐÍ
' lx=0 µ½·ÖÖÓ lx=1 µ½Ð¡Ê± lx=2 µ½Ìì lx=3 µ½ÔÂ
'·µ»ØÖµ£ºÉú³Éʱ¼äµÄÕûÊýÖµ(×îСµ½·ÖÖÓ)
'ʾ Àý£º
'********************************* ......
2.1 ASP.net ÈëÃÅ
¡¡¡¡Í¨³£Ì¸Ò»¸öѧ¿Æ£¬ÎÒÃÇÀÏÊÇ˵£¬ËüÈëÃźܼòµ¥µÄÂASP.netÒ²ÊÇ¡£ASP.netÌá³öÒ»¸ö¸ÅÄ¾ÍÊÇÈÏΪWEBÒ³Ã棬ҲÊÇÒ»¸ö´°Ì壬ËùÒÔ£¬Ñ§Ï°¹ýÃæÏò¶ÔÏó±à³ÌµÄVB VC BC DephiµÄÅóÓÑ£¬Ñ§ÆðÀ´¾Í¼òµ¥¶àÁË¡£
¡¡¡¡Ò»¸öASP.netÒ³ÃæµÄºó׺ÃûÊÇ".aspx"£¬ËùÒÔ£¬IISÔÚÄã°²×°ÍêASP.netʱ£¬Ò²»á°ÑDefault.aspx×÷ΪÄãµÄĬÈÏ ......
fixÊÇbmpµÄÒ»ÖÖÑÜÉú¸ñʽ£¬¿ÉÓÃÓÚaspÉú³ÉÑéÖ¤ÂëͼÐΡ£
Ò»¸öÀý×Ó£º
1 ͼÏó»æÖÆÍê³Éºó£¬½«Îļþ´æΪ24λλͼ¸ñʽµÄBMPͼÏóÎļþ¡£
2 È¥³ýÇ°54ByteÄÚÈÝ.
3 ¸ÄÃûΪBODY+Êý×Ö.FIX
4 ÐÞ¸ÄCHECKCODE.ASP,µ÷ÓÃÄãÐÂ×öµÄÕâ¸öÎļþ.
£¨checkcode.asp ¸ºÔðÉú³ÉºÍÊä³öÑéÖ¤Âë 1309 byte£¬head.fix ÊÇ54byteµÄBMPÍ·£¬body.fix Êý×Ö0~9 10 ......
¿Í»§¶Ë´úÂ룺
<!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>Ê ......