ASP ±à³ÌÖÐ 20 ¸ö·Ç³£ÓÐÓõÄÀý×Ó
1.ÈçºÎÓÃAspÅжÏÄãµÄÍøÕ¾µÄÐéÄâÎïÀí·¾¶
´ð£ºÊ¹ÓÃMappath·½·¨
< p align="center" >< font size="4" face="Arial" >< b >
The Physical path to this virtual website is:
< /b >< /font >
< font color="#FF0000" size="6" face="Arial" >
< %= Server.MapPath("\")% >
< /font >< /p >
2.ÎÒÈçºÎÖªµÀʹÓÃÕßËùÓõÄä¯ÀÀÆ÷?
´ð£ºÊ¹ÓÃthe Request object·½·¨
strBrowser=Request.ServerVariables("HTTP_USER_AGENT")
If Instr(strBrowser,"MSIE") < > 0 Then
Response.redirect("ForMSIEOnly.htm")
Else
Response.redirect("ForAll.htm")
End If
3.ÈçºÎ¼ÆËãÿÌìµÄƽ¾ù·´¸´·ÃÎÊÈËÊý
´ð£º½â¾ö·½·¨
< % startdate=DateDiff("d",Now,"01/01/1990")
if strdate< 0 then startdate=startdate*-1
avgvpd=Int((usercnt)/startdate) % >
ÏÔʾ½á¹û
< % response.write(avgvpd) % >
that is it.this page have been viewed since November 10,1998
4.ÈçºÎÏÔʾËæ»úͼÏó
< % dim p,ppic,dpic
ppic=12
randomize
p=Int((ppic*rnd)+1)
dpic="graphix/randompics/"&p&".gif"
% >
ÏÔʾ
< img src="< %=dpic% >" >
5.ÈçºÎ»Øµ½ÏÈÇ°µÄÒ³Ãæ
´ð£º< a href="< %=request.serverVariables("Http_REFERER")% >" >preivous page< /a >
»òÓÃͼƬÈ磺< img src="arrowback.gif" alt="< %=request.serverVariables("HTTP_REFERER")% >" >
6.ÈçºÎÈ·¶¨¶Ô·½µÄIPµØÖ·
´ð£º< %=Request.serverVariables("REMOTE_ADDR)% >
7.ÈçºÎÁ´½áµ½Ò»¸±Í¼Æ¬ÉÏ
´ð£º< % @Languages=vbscript % >
< % response.expires=0
strimagename="graphix/errors/erroriamge.gif"
response.redirect(strimagename)
% >
8.Ç¿ÆÈÊäÈëÃÜÂë¶Ô»°¿ò
´ð£º°ÑÕâ¾ä»°·ÅÔØÒ³ÃæµÄ¿ªÍ·
< % response.status="401 not Authorized"
response.end
% >
9.ÈçºÎ´«µÝ±äÁ¿´ÓÒ»Ò³µ½ÁíÒ»Ò³
´ð£ºÓà HIDDEN ÀàÐÍÀ´´«µÝ±äÁ¿
< % form method="post" action="mynextpage.asp" >
< % for each item in request.form % >
< input namee="< %=item% >" type="HIDDEN"
value="< %=server.HTMLEncode(Request.form(item)) % >" >
< % next % >
< /form >
10.ΪºÎÎÒÔÚ asp ³ÌÐòÄÚʹ
Ïà¹ØÎĵµ£º
¡¡ASPÁ¬½ÓÊý¾Ý¿âµÄ11ÖÖ·½·¨——±¾ÎÄ×ܽáÁËʹÓÃASPÁ´½Ó¸÷ÖÖÊý¾Ý¿âµÄ·½·¨£º
¡¡¡¡1.AccessÊý¾Ý¿âµÄDSN-lessÁ¬½Ó·½·¨:
set adocon=Server.Createobject("adodb.connection")
adoconn.Open"Driver={Microsoft Access Driver(*.mdb)};DBQ="& _
Server.MapPath("Êý¾Ý¿âËùÔÚ·¾¶")
¡¡¡¡2.Access OLE DBÁ¬½Ó·½·¨£ ......
aspÖеÄrs.openÓÚconn.executeµÄÇø±ð
rs.open sql,conn£ºÈç¹ûsqlÊÇdelete,update,insertÔò»á·µ»ØÒ»¸ö¹Ø±ÕµÄ¼Ç¼¼¯£¬ÔÚʹÓùý³ÌÖв»ÒªÀ´¸örs.closeÔÚÎļþ×îºóÔÙдrs.close
Öмä¿ÉÒÔÀ´¶à¸ö¼Ç¼¼¯rs1.open sql1,conn£¬×îºóÒ»¿é¹Ø±Õ¼Ç¼¼¯:rs.close rs1.close
con ......
Ê×ÏÈÌù´úÂ룺
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim objDic
Dim arr(2)
arr(0) = 0
arr(1) = 1
arr(2) = 2
Set objDic = Server.CreateObject("Scripting.Dictionary")
objDic.Add "key",arr
Response.Write("ÕâÊÇÐÞ¸Ä֮ǰµÄÖµ£º" & objDic.Item("key")(0))
objDic.Item("key")(1) = ob ......
ASP.NET Web ²¿¼þÊÇÒ»×鼯³É¿Ø¼þ£¬ÓÃÓÚ´´½¨Íøվʹ×îÖÕÓû§¿ÉÒÔÖ±½Ó´Óä¯ÀÀÆ÷ÐÞ¸ÄÍøÒ³µÄÄÚÈÝ¡¢Íâ¹ÛºÍÐÐΪ¡£ÕâЩÐ޸ĿÉÒÔÓ¦ÓÃÓÚÍøÕ¾ÉϵÄËùÓÐÓû§»ò¸ö±ðÓû§¡£µ±Óû§ÐÞ¸ÄÒ³ºÍ¿Ø¼þʱ£¬¿ÉÒÔ±£´æÕâЩÉèÖÃÒÔ±ã¿çÒÔºóµÄ¸÷ä¯ÀÀÆ÷»á»°±£ÁôÓû§µÄ¸öÈËÊ×Ñ¡ÏÕâÖÖ¹¦ÄܳÆΪ¸öÐÔ»¯ÉèÖá£ÕâЩ Web ²¿¼þ¹¦ ......
1.´íÎóÐÅÏ¢
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server ²»´æÔÚ»ò·ÃÎʱ»¾Ü¾ø
ÔÒò£º
2005ÀïËƺõ²»Ö§³Ö“(local)”ºÍ“µã”½«Æä¸ÄΪ·þÎñÆ÷µÄÃû³Æ¡£
2000ÊÇ¿ÉÒԵġ£ËùÒÔ²»»á³öÏÖÕâÑùµÄÎÊÌâ¡£
2.´íÎóÐÅÏ¢
´íÎóÀàÐÍÒ»£º
Mi ......