ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[±Ð¾Ç] (ASP±Ð¾Ç²Ä15½g) ¸ê®Æ®w«O¥þ»P¦s¨ú

[±Ð¾Ç] (ASP±Ð¾Ç²Ä15½g) ¸ê®Æ®w«O¥þ»P¦s¨ú

ÁöµM¨Ï¥Î¸ê®Æ®w¨Ó¦s©ñ»PºÞ²z¸ê®Æ¬O«D±`¤è«K¥B¦³®Ä²vªº¡A¦ý¬O¡A·íÂsÄýªÌª¾¹D¤F§Ú­Ì¸ê®Æªº¸ê®Æ®wÀɮצWºÙ»P¸ê®Æ®wÀɮשҦbªº¸ô®|¦ì¸m¡A³o¼ËÂsÄýªÌ´N¥i§Q¥Î¶W³sµ²¦s¨úªº¤è¦¡±N§Ú­Ìªº¸ê®Æ®wÀɮפU¸üÀx¦s°_¨Ó¤F¡A±z¤£­n»¡¤£·|Ëç¡Iºô¸ô¤W§O¨ã¥Î¤ßªº¤H¥i¦hµÛ©O¡C

¬°¤FÁקK§Ú­Ìªº¸ê®Æ®wÀɮ׳Q¬Y¤@¨Ç§O¨ã¥Î¤ßªºÂsÄýªÌ³sµ²¤U¸ü¡A¦Ó¶i¦æ¤£·íªº¯}Ãa¦æ¬°¡A¦]¦¹§Ú­Ì¥²¶·±N¦s©ñ¸ê®Æªº¸ê®Æ®wÀɮפº®e¥[¥H½s½X¡A¦P®É±N¸ê®Æ®w¥[¤W¦w¥þÂê¡A¥H±K½X³]©wªº¤è¦¡¨Ó¶i¦æ¸ê®Æ®wÀɮתº«O¥þ±¹¬I¡C

¸ê®Æ®wÀɮתº½s½X
­n¦p¦ó¬°¸ê®Æ®wÀÉ®×½s½X¡H¦]¬°§Ú­Ì©Ò¤¶²Ðªº¸ê®Æ®w³£¬O±Ä¥ÎACCESS¸ê®Æ®wÀÉ®×Ãþ«¬¡A¦]¦¹¡I§Ú­Ì´N¥HACCESS¸ê®Æ®wÀÉ®×Ãþ«¬¬°¹ï¶H¨Ó¥[¥H¸Ñ»¡¡C
­º¥ý¡A§Ú­Ì¨ÓÁA¸Ñ¤@¤U¡G¸ê®Æ®wÀÉ®×½s½Xªº¥Øªº¬°¦ó¡H¨ä¥Øªº¤D¬O±N¸ê®ÆªpÀɮפº®e¥[¥H§ï½s¦¨¤@¯ë¬Ý¨Ó²@µL·N¸qªº¶Ã½X¤º®e¡A§Ú­Ì±N¸ê®Æ®wÀÉ®×½s½X«á¡A´N¥i¥H¹w¨¾¦³¤ßªÌ§Q¥Î¬Y¨Ç½s¿è¾¹±ÄÀÉ®×À˵ø½s¿èªº¤è¦¡¨Ó¬d¬Ý§Ú­Ì¸ê®Æ®wÀɮתº¤º®e¡A´Nµ§ªÌªº¸gÅç¡A§Q¥Î¦¹¤è¦¡¨Ó¬d¬Ý¸ê®Æ®wÀɮתº¤º®e¡A½T¹ê¥iÀò±o¬Y¨Çµ{«×ªº¸ê°T¡A¦]¦¹¡A¸ê®Æ®wÀÉ®×½s½Xªº·N¸q»P¹ê½è®Ä¯à¬O«Ü¤jªº¡C

ACCESS¸ê®Æ®wÀÉ®×½s½Xªº¨BÆJ¡G
¨BÆJ¤@¡G
    ª½±µ¶}±ÒACCESSµ{¦¡¡A¦ý¬O½Ð¥ý¤£­n±N±ý¶i¦æ½s½Xªº¸ê®Æ®wÀɮ׶}±Ò(¦b¼ÐÃD¦C¤¤¥u¦³"Microsoft Access"³o¨â­Ó­^¤å³æ¦r)¡G
1.png

¨BÆJ¤G¡G
    ª½±µ¶}±ÒACCESSµ{¦¡«á¡A¿ï¨ú¤U©Ô¦¡¥\¯àªí¡y¤u¨ã¡z-->¡y«O¥þ¡z-->¡y¥[±K¡þ¸Ñ±K¸ê®Æ®w¡z¡C
2.png

ª`·N¡G
³o¸Ìªº¡y¥[±K¡þ¸Ñ±K¸ê®Æ®w¡z¨Ã¤£¬O¥[¤W±K½X³á¡I³o¬O»y¨¥Â½Ä¶ªºÃö«Y©Ò³y¦¨ªº»~·|¡A¯u¥¿ªº±K½XÂê©w¡A±N¦b«áÄòªº¨BÆJ¤¤¸Ñ»¡¡C


¨BÆJ¤T¡G
    ¿ï¨ú¤U©Ô¦¡¥\¯àªí¡y¥[±K¡þ¸Ñ±K¸ê®Æ®w¡z¥\¯à¶µ¥Ø«á¡A±µµÛ·|¥X²{¤@­Ó¦W¬°¡y¸ê®Æ®w¥[±K¡þ¸Ñ±K¡zªº¹ï¸Üµøµ¡¡AµM«á½Ð¿ï¾Ü§Ú­Ì­n¶i¦æ½s½X°Ê§@ªº¸ê®Æ®wÀɮסA¿ï¾Ü§¹²¦«áª½±µ«ö¤U¡y½T©w¡z«ö¶s¡C


¨BÆJ¥|¡G
    ¦b¡y¸ê®Æ®w¥[±K¡þ¸Ñ±K¡zªº¹ï¸Üµøµ¡¤¤¡A¿ï¾Ü§Ú­Ì­n½s½Xªº¸ê®Æ®wÀɮרëö¤U¡y½T©w¡z«ö¶s«á¡A±N·|¦A¥X²{¤@­Ó¦W¬°¡y¸ê®Æ®w¥[±K«á¥t¦s¦¨¡zªº¹ï¸Üµøµ¡¡A½Ð¦b¨ä¤¤ªº¡yÀɮצWºÙ¡zÄæ¦ì¤¤¶ñ¤J¶i¦æ½s½X°Ê§@«á¸ê®Æ®wÀɮתº¦WºÙ(¥»¨Ò¬°newteach.mdb)¡AµM«á«ö¤U¡yÀx¦s¡z«ö¶s¡A¦p¦¹¤@¨Ó¡A­ì¥»¥¼¶i¦æ½s½Xªºteach.mdb¸ê®Æ®wÀÉ®×´N·|³Q¥[¥H½s½X¡A¨Ã¥B¥t¦s¬°newteach.mdbÀɮסC

³o¼Ë´N§¹¦¨¤FACCESS¸ê®Æ®wÀɮתº½s½X¤u§@¡A²³æ§a¡I
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

Âê½X¸ê®Æ®w¦s¨ú
·í§Ú­Ì¤w¸g§¹¦¨¤F¸ê®Æ®wÀɮפWÂꪺ°Ê§@¥H«á¡A¨ºASP­n¦p¦ó¨Ó³sµ²¦s¨ú³o­Ó¤w¸g¤WÂꪺ¸ê®Æ®wÀɮשO¡H¦pªG§Ú­Ì¦b¶i¦æ¸ê®Æ®w³sµ²ªº®É­Ô¨S¦³«ü©w³sµ²ªº¶}±Ò±K½X¡A«hASPµ{¦¡±N¦]µLªk¶}±Ò¸ê®Æ¦Ó²£¥Í¿ù»~¡A¦p¤U¹Ï©Ò¥Ü¡G
6-21.png

¨º§Ú­Ì¸Ó¦p¦ó¶}±Ò¤w³]©w±K½X¥[Âꪺ¸ê®Æ®wÀɮשO¡H·í§Ú­Ì«Ø¥ß¤@­Ó¸ê®Æ®w³sµ²ª«¥óConnectionª«¥ó«á¡A§Ú­Ì¤D¬O§Q¥ÎConnectionª«¥óªºOpen¤èªk¨Ó¶}±Ò¸ê®Æ®w¡A³q±`§Ú­Ì¥uµ¹¤FOpen¤èªk¨â­Ó°Ñ¼Æ¡G¸ê®Æ®wÅX°Êµ{¦¡ªºDriver°Ñ¼Æ»P±ý¶}±Òªº¸ê®Æ®wÀɮק¹¾ã¸ô®|ÀɦWDbq°Ñ¼Æ¡A²{¦b¡A¬°¤F¶}±Ò¤w³]©w±K½X¥[Âꪺ¸ê®Æ®wÀɮסA§Ú­Ì¥²¶·¦A¥[¤W¤@­Ó±K½XPwd°Ñ¼Æ¡C

²{¦b´N°²³]§Ú­Ì¦³¤@­Ó¦ì½s½X¥[±Kªº¸ê®Æ®wÀÉ®×teach.mdb¡A¥H¤Î¤@­Ó§Ú­Ì§¹¦¨½s½X»P±K½X³]©wªºnewteach.mdb¸ê®Æ®wÀɮרӻ¡©ú¡G¹ï©ó¥¼½s½X¥[±Kªº¸ê®Æ®wÀÉ®×teach.mdb¡A¦b³sµ²¸ê®Æ®w®É§Ú­Ì¥u·|¨Ï¥Î¨â­Ó°Ñ¼Æ¡G
  1. Set conobject = Server.CreateObject("ADODB.Connection")
  2. DBPath = Server.MapPath("teach.mdb")conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
½Æ»s¥N½X
²{¦b­Y§Ú­Ì­n¶}±Òªº¬O¤@­Ó³]©w±K½X¤WÂꪺ¸ê®Æ®wÀÉ®×newteach.mdb¡A§Ú­Ì´N¥²¶·¦bConnectionª«¥óªºOpen¤èªk¤¤¦A¼W¥[¤@­Ó¡yPwd¡zªº°Ñ¼Æ¡G
  1. Set conobject = Server.CreateObject("ADODB.Connection")
  2. DBPath = Server.MapPath("newteach.mdb")conobject.Open "Driver={Microsoft Access Driver (*.mdb);pwd=1234;};
  3. DBQ="&DBPath
½Æ»s¥N½X
¡yPwd=1234¡z´N¬O¥Nªí¦b³sµ²¶}±Ò¸ê®Æ®w®É¦P®É¶Ç°e¥X¤@²Õ±K½X¡y1234¡z¡A´N¦p¦P¥ÎAccess¶}±Ò¤WÂꪺ¸ê®Æ®wÀɮ׮ɩó¡y»Ý­n±K½X¡zªº¹ï¸Üµøµ¡¤¤¶ñ¤J±K½X¬O¬Û¦Pªº·N«ä¡C

check.asp(¥¼¥[±K½X°Ñ¼Æ)
  1. <%
  2. ID=Request("ID")  
  3. Password = Request("Password")
  4. ok=session("checkok")
  5. IF ok <> "yes" Then
  6.         Set conobject = Server.CreateObject("ADODB.Connection")
  7.         DBPath = Server.MapPath("newteach.mdb")
  8.         conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
  9.         Set recobject=Server.CreateObject("ADODB.Recordset")
  10.         SQL = "Select * From ±Ð¾­û»{ÃÒ Where ID='" & ID & "'"
  11.            SQL = SQL & " And Password = '" & Password & "'"
  12.            recobject.Open SQL,conobject,1,1,1
  13.                    if Not recobject.Eof then
  14.                    ok = "yes"
  15.                    session("checkok")=ok
  16.             else
  17.             %>
  18. <HTML>
  19. <BODY>
  20. <h2 ALIGN="CENTER"><img border="0" src="login.gif"></h2>
  21. <CENTER>
  22. <FORM Action=<%=Request.ServerVariables("PATH_INFO")%> Method=post>
  23. <TABLE BORDER=1 CELLSPACING=0 >
  24.    <TR><TD ALIGN=RIGHT>µn¤J¦WºÙ:</TD>
  25.    <TD><Input Type=Text Name=ID Size=10></TD></TR>
  26.    <TR><TD ALIGN=RIGHT>µn¤J±K½X:</TD>
  27.    <TD><Input Type=Password Name=Password Size=8></TD></TR>
  28. </TABLE><P>
  29. <INPUT Type=Submit Value=" ½T ©w ">
  30. </FORM>
  31. </CENTER>
  32. </BODY>
  33. </HTML>
  34. <%
  35. Response.End
  36.             end if   
  37. End If
  38. %>
½Æ»s¥N½X
¥¼¥[±K½X°Ñ¼Æ¡A¤@¶i¤Jºô­¶´N¥X²{¿ù»~¡G
6-22.png

pwdcheck.asp(¥[±K½X°Ñ¼Æ)
  1. %
  2. ID=Request("ID")  
  3. Password = Request("Password")
  4. ok=session("checkok")
  5. IF ok <> "yes" Then
  6.         Set conobject = Server.CreateObject("ADODB.Connection")
  7.         DBPath = Server.MapPath("newteach.mdb")
  8.         conobject.Open "Driver={Microsoft Access Driver (*.mdb)};pwd=1234;DBQ="&DBPath
  9.         Set recobject=Server.CreateObject("ADODB.Recordset")
  10.         SQL = "Select * From ±Ð¾­û»{ÃÒ Where ID='" & ID & "'"
  11.            SQL = SQL & " And Password = '" & Password & "'"
  12.            recobject.Open SQL,conobject,1,1,1
  13.                    if Not recobject.Eof then
  14.                    ok = "yes"
  15.                    session("checkok")=ok
  16.             else
  17.             %>
  18. <HTML>
  19. <BODY>
  20. <h2 ALIGN="CENTER"><img border="0" src="login.gif"></h2>
  21. <CENTER>
  22. <FORM Action=<%=Request.ServerVariables("PATH_INFO")%> Method=post>
  23. <TABLE BORDER=1 CELLSPACING=0 >
  24.    <TR><TD ALIGN=RIGHT>µn¤J¦WºÙ:</TD>
  25.    <TD><Input Type=Text Name=ID Size=10></TD></TR>
  26.    <TR><TD ALIGN=RIGHT>µn¤J±K½X:</TD>
  27.    <TD><Input Type=Password Name=Password Size=8></TD></TR>
  28. </TABLE><P>
  29. <INPUT Type=Submit Value=" ½T ©w ">
  30. </FORM>
  31. </CENTER>
  32. </BODY>
  33. </HTML>
  34. <%
  35. Response.End
  36.             end if   
  37. End If
  38. %>
½Æ»s¥N½X
¨Ï¥Î¥[±K½X°Ñ¼Æ³sµ²¸ê®Æ®w¡A¥i¥¿½T¬Ý¨ìµn¤Jµe­±¡G
6-23.png


§¹¾ã½d¨Ò»P¸ê®Æ®wÀÉ®×:

psw.rar (120.98 KB)

¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¸ê®Æ®wÀÉ®×±K½X³]©w
§¹¦¨¸ê®Æ®wÀɮתº½s½X°Ê§@«á¡A±µ¤U¨Ó´N¬O¬°§Ú­Ìªº¸ê®Æ®wÀɮ׶i¦æ¡y±K½X³]©w¡zªº°Ê§@¡A±K½X³]©w¬O«ü¦b¥HACCESS¶}±Ò¸ê®Æ®wÀɮ׮ɡA¥H¿é¤J±K½Xªº¤è¦¡½T»{¾Þ§@ªÌ¨­¤Àªº°Ê§@¡G

¨BÆJ¤@¡G
    ¶}±ÒACCESSµ{¦¡«á¡A¿ï¨ú¤U©Ô¦¡¥\¯àªí¡yÀɮסz-->¡y¶}±ÒÂÂÀÉ¡z¡C
6-16.png

¨BÆJ¤G¡G
    ¿ï¨ú¤U©Ô¦¡¥\¯àªí¡y¶}±ÒÂÂÀÉ¡z¥\¯à¶µ¥Ø«á¡A±µµÛ·|¥X²{¤@­Ó¦W¬°¡y¶}±Ò¸ê®Æ®w¡zªº¹ï¸Üµøµ¡¡AµM«á½Ð¿ï¾Ü§Ú­Ì­n¶i¦æ±K½XÂê©wªº¸ê®Æ®wÀɮסA¿ï¾Ü§¹²¦«á±µµÛ«ö¤U¡y¶}±Ò¡z«ö¶s¥k¤èªº¤T¨¤§Î¤U©Ô«ö¶s¡A¿ï¨ú¡y¿W¥e¦¡¶}±Ò¡z¤è¦¡¨Ó¶}±Ò¸ê®Æ®wÀɮסC


¨BÆJ¤T¡G
    ¥H¡y¿W¥e¦¡¶}±Ò¡z¤è¦¡¨Ó¶}±Ò¸ê®Æ®wÀɮ׫á¡A±µµÛ¿ï¨ú¤U©Ô¦¡¥\¯àªí¡y¤u¨ã¡z-->¡y«O¥þ¡z-->¡y³]©w¸ê®Æ®w±K½X¡z¡G
6-18.png

¨BÆJ¥|¡G
    ¿ï¨ú¤U©Ô¦¡¥\¯àªí¡y³]©w¸ê®Æ®w±K½X¡z¥\¯à¶µ¥Ø«á¡A±µµÛ·|¥X²{¤@­Ó¦W¬°¡y³]©w¸ê®Æ®w±K½X¡zªº¹ï¸Üµøµ¡¡AµM«á½Ð¦b¹ï¸Üµøµ¡ªº¡y±K½X¡zÄæ¦ì¤¤¶ñ¤J±z­n³]©wªº¶}±Ò±K½X(¥»¨Ò±K½X¬°"1234")¡A±µµÛ¦b¡yÅçÃÒ¡zÄæ¦ì¤¤¦A¶ñ¤J¤@¦¸±z­è­è¦b¡y±K½X¡zÄæ¦ì¤¤©Ò¶ñ¤J¶}±Ò±K½X¡A¶ñ¼g§¹²¦«áª½±µ«ö¤U¡y½T©w¡z«ö¶s¡G
6-19.png

¨BÆJ¶i¦æ¨ì¦¹§Ú­Ì´N¤w¸g§¹¦¨¤F¸ê®Æ®wÀɮפWÂꪺ°Ê§@¡A¥H«á­Y­n¨Ï¥ÎAccess¨Ó¶}±Ò³o­Ó¸g¹L§Ú­Ì³]©w±K½X¥[Âꪺ¸ê®Æ®wÀɮסAAccess´N·|¥X²{¤@­Ó¡y»Ý­n±K½X¡zªº¹ï¸Üµøµ¡­n¨D¾Þ§@ªÌ¥ý¿é¤J±K½X(¦p¤U¹Ï©Ò¥Ü)¡A¿é¤J¥¿½Tªº±K½X«á¤~¥i¥H¶}±Ò¾Þ§@³o­Ó³]©w±K½X¥[Âꪺ¸ê®Æ®wÀɮסC
6-20.png
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¡i¥Í©R¦b©I§l¶¡¡j¦òªû»¡¡G¡u¥Í©R¦b©I§l¶¡¡C¡v¤HµLªkºÞ¦í¦Û¤vªº¥Í©R¡A§óµLªk¾×¦í¦º´Á¡AÅý¦Û¤v¥Ã¦í¤H¶¡¡C¬JµM¥Í©R¥h¨Ó³o»òµL±`¡A§Ú­Ì§óÀ³¸Ó¦n¦n¦a·R±¤¥¦¡B§Q¥Î¥¦¡B¥R¹ê¥¦¡AÅý³oµL±`¡BÄ_¶Qªº¥Í©R¡A´²µo¥¦¯uµ½¬üªº¥ú½÷¡A¬M·Ó¥X¥Í©R¯u¥¿ªº»ù­È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD