Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP ÏÞÖÆ·¢Ìûʱ¼ä ºÍ µÇ½ÏÞÖÆ


н¨Á¢Ò»¸öASPÎļþ °Ñ ÒÔÏ´úÂë¸´ÖÆ½øÈ¥
<%
ip=request.ServerVariables("REMOTE_ADDR") '»ñÈ¡À´·ÃµÄIPµØÖ·
dim conn
set conn=server.CreateObject("ADODB.connection")
conn.open "Dbq="&server.MapPath("yb/dat/data.mdb")&";Driver={Microsoft Access Driver (*.mdb)}" '½¨Á¢Êý¾Ý¿âÁ¬½Ó ÕâÀïÄã¿ÉÒÔ×Ô¼º¸Ä
sql="select * from ip_user where ipµØÖ·='"&ip&"'"
set rs=server.CreateObject("ADODB.recordset")
rs.open sql,conn,3,3
if rs.eof then
call ip_fir("thenew")
else
vistime=rs("·ÃÎÊʱ¼ä")
if DateDiff("h",vistime,now)>=12 then
call ip_fir("theup")
else
call ip_notfir
end if
end if
%>
<%'--------------ΪÁË·½±ãд³ÉÁ˹ý³ÌÐÎʽ£º
Sub Ip_fir(action)'---------------------µÚÒ»´Î·ÃÎʵĹý³Ì
response.write "12СʱÄÚ£¬ÄãÊǵÚÒ»´Î·ÃÎʱ¾Õ¾£¬ÕâÀïÌùÉϼÓÁ÷Á¿´úÂë"
if action="theup" then
rs("·ÃÎÊʱ¼ä")=now()
rs.update
elseif action="thenew" then
sql1="insert into ip_user(ipµØÖ·) values ('"&request.ServerVariables("REMOTE_ADDR")&"')"
conn.execute(sql1)
end if
End Sub
Sub ip_notfir()''---------------------12СʱÄÚ·ÃÎʹýµÄ¹ý³Ì
'---------------------ÕâÀï¸Ä³ÉÄãÆÚ´ýµÄ´¦Àí·½Ê½
response.write "ÄãÔÚ×î½ü12СʱÄÚ·ÃÎʹý±¾Õ¾"
End Sub
%>
check_inTimeÊÇʱ¼äTime(±ÈÈç8:30:00)
tuihour=hour(rs("check_inTime"))
tuiMinute=Minute(rs("check_inTime"))
chaotime=TimeSerial(tuihour,tuiMinute+10,0)'ÓÃÕâ¸öʱ¼äº¯Êý·µ»ØÒ»¸öʱ¼ä£¡¾ÍÊÇÍùºó¼Ó10·ÖÖÓ¡£Èç¹ûÊÇcheck_inTimeÊÇ8:30:00£¬ÄÇô·µ»ØÊ±¼äΪ£º8:40:00 ¡£
if chaotime>time then
Response.Redirect("cuo.asp?id=3")'´íÎó´¦ÀíÒ³Ãæ£¡¿ÉÒÔÔÚÕⶨÒå˵ʮ·ÖÖÓºó²ÅÄܹ»×¢²á£¡
end if
µÇ½´íÎó5´ÎËø¶¨30·Ö
If LoginType = "Ò»°ã¹ÜÀíÔ±" Then
sql = " Select * from ÆóÒµÖ®ÐǹÜÀíÔ±×ÊÁϱí Where ¹ÜÀíÔ±µÇ¼ID = '" & User & "' "
DBRs.Open sql,DBConn,1,3
If DBRs.EOF Then
DBRs.Close
Set DBRs = Nothing
DBConn.Close
Set DBConn = Nothing
Response.Write "<script>alert('Óû§Ãû»òÕßÃÜÂë´íÎó£¬ÇëÖØÐÂÊäÈë');history.back();</script><br><p>"
Response.End
Else
'=======


Ïà¹ØÎĵµ£º

vfp/(asp/vfpdll/Sql)

ÒÔÏÂÊÇ·¢ÔÚ÷×ÓÂÛ̳µÄÌù×Ó£¬×ª·¢¹ýÀ´£¬Ï£Íû¸øÓõÃ×ŵĺüÓѲο¼¡£
ÎҵijÌÐòÒÔǰһֱÊÇÓû¨Éú¿Ç°ó¶¨IPʵÏÖµÄÔ¶³Ì£¬ÓÉÓÚ¿Í»§·þÎñÆ÷ºÍ¿Í»§¶Ë¶¼ÊÇͨ¹ý¿í´øÉÏÍø£¬Ò»°ãµÄ²Ù×÷£¨¿ª½ø»õµ¥¡¢ÏúÊÛµ¥µÈ£©ËÙ¶ÈÒ²»¹²»´í£¬µ«ÊÇÔÚÔ¶³Ì¿Í»§¶ËÐÞ¸ÄÉÌÆ·×ÊÁÏ£¨10000¶àÌõ¼Ç¼£©¡¢²éѯһ¶ÎʱÆÚµÄ½øÏú´æÁ÷Ë®£¨Ò»ÖÜ5000ÌõÒÔÉÏ£©µÈÉæ¼°µ½È¡¼Ç¼Á¿´óµ ......

aspÁ´½ÓsqlÊý¾Ý¿â ´úÂë

 dim conn,connstr
Set conn = Server.CreateObject("ADODB.Connection")'´´½¨Ò»¸öÊý¾Ý¿âÁ´½Ó¶ÔÏóconn£¬·½±ãºóÃæµ÷ÓÃ
connstr="Provider=SQLOLEDB;Data Source=(local);Initial Catalog=111;User ID=sa;Password=1234;" '´´½¨Ò»¸öÊý¾Ý¿âµÄrecordset¶ÔÏ󣬷½±ãÒÔºóµ÷ÓÃ
conn.Open connstr'´ò¿ªÊý¾Ý¿â ......

µÚÒ»Õ ASP½éÉÜ

½ÌѧÄÚÈÝ
ASP¶¯Ì¬ÍøÒ³Éè¼Æ¼¼ÊõÌåϵ½á¹¹
ASPÖ÷Òª¹¹³ÉÔªËØµÄ¹¦Äܼ°Ó÷¨
ASP¶¯Ì¬ÍøÒ³Éè¼ÆÊµÀý
ÖØµãºÍÄѵã
asp¶¯Ì¬ÍøÒ³Éè¼Æ¼¼ÊõÌåϵ½á¹¹
asp¶¯Ì¬ÍøÒ³Éè¼ÆµÄ·½·¨
ǰµ¼ÖªÊ¶
½Å±¾ÓïÑÔ——vbscript»òjavascript
Êý¾Ý¿â֪ʶ——SQL
²ÎÔÄ×ÊÁÏ
HTTP://WWW.w3schools.com
ÍÆ¼öÈí¼þ£ºAdobe Dreamweaver ......

ASP×Ö·û´®º¯Êý´óÈ«

º¯Êý Óï·¨ ¹¦ÄÜ
Len Len(string|varname) ·µ»Ø×Ö·û´®ÄÚ×Ö·ûµÄÊýÄ¿£¬»òÊÇ´æ´¢Ò»±äÁ¿ËùÐèµÄ×Ö½ÚÊý¡£
Trim Trim(string) ½«×Ö·û´®Ç°ºóµÄ¿Õ¸ñÈ¥µô
Ltrim Ltrim(string) ½«×Ö·û´®Ç°ÃæµÄ¿Õ¸ñÈ¥µô
Rtrim Rtrim(string) ½«×Ö·û´®ºóÃæµÄ¿Õ¸ñÈ¥µô
Mid Mid(string,start,length) ´Óstring×Ö·û´®µÄstart×Ö·û¿ªÊ¼È¡µÃlength³¤¶ ......

ASP¿Ø¼þ´óÈ«½²½â

4.1 ³£ÓõÄHTML¿Ø¼þ
4.1.1 ±íµ¥¿Ø¼þ
ÓÃÓÚ½ÓÊÕ¿Í»§¶ËµÄÊäÈ룬²¢½«ÊäÈëµÄ½á¹ûÌá½»¸ø·þÎñÆ÷´¦Àí
1.HtmlForm¿Ø¼þ
 ËùÓеÄWeb Form¿Ø¼þ±ØÐë°üº¬ÔÚÒ»¶ÔHtmlForm¿Ø¼þ±êÇ©ÖÐ
<Form
   Id = "¿Ø¼þ±êʶ"
   Runat = "Server"
   Method = "Post | Get"
   Action = "ÒªÖ´ÐÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ