|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
只要你想学,就没什么优缺点,上面那位大哥已经把网上的评论说了,但我认为想学哪个都一样,不然它就不可能在当今时代数字艺术方面存活到今天Thisisthecomplexpart-youmustmakesureeveryonesbidsarecorrect,updatethosethathaveproxybids,reallocatelotstowinners,notifybuyerswhohavebeenoutbid,andperformsomeupkeep.
Firstletslookatthecodetoaddabid.
FunctionDoBid(ItemID,BidderID,Price,optionalMaxPrice,optionalMaxItems)
Setvariablesandcreateobjects
strConnectionString="DSN=MyAuction;UID=username;PWD=password;Database=MyAuctionDB"
setrst=Server.CreateObject("ADODB.Recordset")
Checktoseeifabidalreadyexistsforthisbuyerandauction
strSQL="SELECTBIDFROMtblAuctionBidsWHEREIID="&ItemID&"AND"&_
"UID="&BidderID
rst.openstrSQL,strConnectionString
ifrst.eofthenAbiddoesnotexist
rst.close
Insertinfointotable
strSQL="INSERTINTOtblAuctionBids(IID,UID,WinPrice,MaxBid,"&_
"BidItems,WinItems,TimeVALUES("&ItemID&","&BidderID&_
","&Price&","&MaxPrice&","&MaxItems&_
",0,"&Now()&")"
DefaultWinItemsto0fornow
elseAbiddoesexist
rst.close
Updateinfointable
strSQL="UPDATEtblAuctionBidsSETWinPrice="&Price&_
"WHEREIID="&ItemID&"ANDUID="&BidderID
endif
rst.openstrSQL,strConnectionString
Fixbiddinginformation
callResolveBids(ItemID)
EndFunction
NOTE:ThiscodeaboveisdevelopedforVisualBasic,andthekeyword"optional"inthefunctionopenerisnotsupportedinVBScript.InanASPthen,simplyleaveoutthekeyword"optional"here,andwhenyoucallthefunction,passinanemptystring,i.e.:
callDoBid(ItemId,BidderID,Price,"","")
Thisfunctionbasicallytakessomeinfo,andeitherinsertsitorupdatesitintheBidstable-fairlysimplestuff.ThefunctionResolveBidshoweveriswhereallthegoodstuffhappens.
结论:和PHP一样,ASP简单而易于维护,很适合小型网站应用,通过DCOM和MTS技术,ASP甚至还可以完成小规模的企业应用,但ASP的致命缺点就是不支持跨平台的系统,在大型项目开发和维护上非常困难。 |
|