??? ??? ?? ?? ?????????? ???, ?????? ????? ?????, ?? ???? Access ??????? ?? ????? ???? ??????? ?????? ???????? ????? ?? ??? ???? ????

???? ?????? ???? ??????
???? ID: 928706 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

?? ????? ??

??????

?? ??? ?? ??? ???? ????? ???? ?? ?? Microsoft ?????????? ???, ?????? ????? ????? (ASP), ?? ???? Microsoft Access ??????? ?? ????? ???? ??????? ??????? ?????? ???? ?? ?? ?? ?????? ??? ??? ?????? ????? ?? ??? ???? ?????
  • ?? ??? ??? ????? ??? ?????????? ??? ?????????? ??????? ?? ??????????? ?? ???????????? ???? ?? ??? ??????? ???? ???? ??? ??? ????? ?? ???? ??? ???? ?????? ???? ???? ???????????? ?? ??? ???? ?? ??????? ??????? ??????? ?????? ???? ?? ??? ??????? ??? ?? ???? ?????, ?????????? ??? ??????? ?????????? ??? ?? ??????? Access ??????? ?? ??? ???? ?? ??? ?????? ?????
  • ?????????? ??? ?? ??????? ??? ????? ???? ??? ??? ??????? ?? ???????? ???? ???? ??????? ??? ?????? ???? ?? ???, ?? ??????? ???? ??? ?? ?? ???????? ????? ???? (SSL) ??????????? ?? ????? ?? ???? ??? ?? ??? ????? ?? ????? ????? ???? ??????? ?? ???, ???? ??? ???? ?? ?????????? ?? ???? ??????? ???? ??????? (ISP) ?? ?????? ?????

?????

?? ???? ????? ???? ?? ?? ?????????? ???, ASP ?? Access ??????? ?? ????? ???? ??????? ?????? ???????? ?? ?? ??? ??? ????? ?? ??? ???? ?????

???? ???????

??? ?? ?????????? ??? ASP ???????? ?? ????? ????

?????????? ??? ??? ?? ASP ???????? ?? ????? ????, ???? ?? ???? ?? ???? ??? ????? ?? ???? ?????-?????? ??? ASP ?? ?????? ???? ?? ?? ????? ???? ?????? ???

??? ?? ?????????? ??? ?? ?? ??? ???? ?????

???:?????? ??????? ????? ?? ?? ???? ??? ???? ??? ???? ????? ?? ?? ????? ???? ????? ?? ???? ??? ???? ?? ??? ?? ??????? ??? ?? ??? ?? ??? ??? ??? ??? ?? ??? ?? ?? ????? ???? ???? ??? ?? ????? ????, ?? ???? ???????? ????? ???? ??? ???? ?????, ???? ?????? ??????? ????? ??? ???? ?? ???? ?? ????? ????????

????? ?? ??? ?? ?? ??? ???? ?????????? ??? ???, ????? ????? ?? ???? ????:
  1. Start Expression Web.
  2. ????? ???????????? ??,????? ????-????? ????, ?? ???? ?????? ?????
  3. ????????????? ????? ???, ????? ????????? ??? ???????????? ??????? ?? ????? ????..
  4. ?????Specify the location of the new Web sitebox, type the location where you want to store the new Web site in the following format:

    HTTP://Servername/Logon
  5. ????? ????,OK.
The new empty Web site that is named logon is opened in Expression Web.

?? ??????? ?????.

You can create database to store user names and passwords by using a database program such as Microsoft Office Access 2003.

???:If you use a database program other than Access 2003 to create the database, modify these steps accordingly.

To create a database, follow these steps:
  1. Access 2003 ?? ??????? ?????
  2. ????? ???????????? ??,???.
  3. ????? ??? ??? ????? ????????? ???????.
  4. ??????:Logon.MDBfor the file name, and then click?????.
  5. ???????????????? ?? ???, ????? ?????????????? ????-????? ????, ?? ???? ??????.
  6. ????? ????,?????? ??????? ????-????? ????, ?? ???? ???OK.
  7. ?? ???? ?????? ???????? ????????, ??????UID.
  8. ???? ??????? ??????:????? ?? ???, ????? ???????????? ????, ?? ???? ??????????? ?????????? ????? ?? ????

    ???:The???????? ???????? ?? ??? ??? ?? ????? ????? ????? ???? ???
  9. ?? ????? ?????? ???????? ????????, ??????PWD?? ????-????? ????, ?? ???? ???????? ????? ?????? ??????? ??????:??????
  10. ????? ???????????? ??,??????.
  11. ??????????? ???????? ???,tblUsers?? ????-????? ????, ?? ???? ???OK.
  12. ????? ????????????? ??,???? ????? ?????.
  13. ?????UID?????, ??????testuser.
    ?????PWD?????, ?????????????.
  14. ????? ???????????? ??,??? ????, ?? ?? Access 2003 ?? ???? ???????
???:??????? ?????? ??, ?? ??? ??????? ??? ??????? ?? ??????, ??????? ??????? ?? ???????? ?? ?? mixture ???? ?? ??? ?????????? ???

??????? ??? ???? ????

?????? ?????????? ??? ?? ??????? ?? ??? ???? ?? ??????? ?????????? ??? ??? ???? ????? ??? ???? ?? ???, ????? ????? ?? ???? ????::
  1. ??? ?????????? ??, ??? ???? ????? ??? ???? ????? ????? ???????? ????????? ????????????, ?? ???? ???????.
  2. ????? ????,????? ??????, ?? ?????? ????? ?? ???? ??? ????? ????Logon.MDB????? ?? ???? ????, ?? ???? ????????.
  3. ????? ????,??????? ??????????:_private/Logon.MDB????????? ??? ??? ????? ?? ???????? ????? ???, ?? ???? ???OK.

    ???:?? ????????? ???? (_) "????" ?? ??? ???? ?? ?? ????? ???
  4. ????? ????,OK??????? ????? ?? ???? ?????
  5. ??? ?? ?? ???? ????? ?? ??? ???? ??????? ??????? ????? ?? ??? ??? ???, ?? ????? ????????.

ASP ????? ?????

?? ?? ????? ?? ??? ????? ???? ?? ??? ?? ?????? ????? ????? ????, ???? ??? ????, ?? "?????????" ????? ?? ???????, ????? ??? ??? ?? ??? ???????? ?? ?? ???? ????? ?? ??? ??? ??? ????? ?????, ?? ????? ????? ????? ???

Microsoft ???????????? ?????? ???? ???????? ?? ??? ??? ???? ??, ???? ??? ??? ?? ?????? ?? ?????????? ??? ??? ?????? ???? ?? ????.. ?????? ???????? ?????? ?? ???? ????? ???????? ?? ??? ???????? ????? ??? ?? ???? ?? ????? ???? ???.. ?? ??? ????? ?? ?? ?? ????? ?? ?? ??? ???????????? ???? ?? ?? ??????? ?? ?????? ??? ????? ????? ???????????? ?? ????? ?? ???? ???? ?? ??? ???? ?? ??? ??.. Microsoft ?????? ???????? ?? ????? ????????? ?? ???????????? ?? ?????? ??? ?????? ?? ???? ???.. ??, ?? ?? ???????? ?? ???? ??????? ?????????? ?? ?????? ???? ?? ??? ???????? ??????????????? ?? ?????? ?? ???????????? ????? ?? ??? ??????? ???? ??????..

??? ????? ?????

?? ????? ???? ???? ?? ??? ??????? ????? ?? ??? ??? ??? ???? ??? ?? ?????? ????????? ????? ?? ?? ????? ??? ?? ???????? ??? ??? ??? ????? ??? ????? ?? ??? ??? ??? ?????, ?? ????? ?? ???? ????:
  1. ??? ?????????? ??, ??? ????? ???????????? ????????????, ?? ???? ????????.
  2. ????????????? ????? ???, ????? ????html????????????? ????? ????, ?? ???? ???OK.
  3. ??? ??? ?? ??????? ??? ???????? ????? ???, ????? ???????:??? ????? ?????? ???
  4. ?? ??? ????, ?? ?? ??? ??? ??? ??? HTML ??? ?? ????????
  5. ???? ???? ?? ??? ??? ??? ????? HTML ??? ?? ????????
    <% @language="vbscript" %>
    <html>
    <head><title>Home Page</title></head>
    <body>
    <h3>Home Page</h3>
    <p>You are logged on as: 
    <%
      If Len(Session("UID")) = 0 Then
        Response.Write "<b>You are not logged on.</b>"
      Else
        Response.Write "<b>" & Session("UID") & "</b>"
      End If
    %>
    </p>
    <ul>
     
    <li><a href="passwordprotect.asp">Password-Protected Page</a></li>
    <li><a href="nonsecure.asp">Nonsecure Page</a></li>
    
    </ul>
    </body>
    </html>
  6. ????? ?? ??? ??? ??????default.asp??? ??????? ??? ???? ????? ??? ???? ???
  7. ????? ???????????? ??,??? ????default.asp ??? ??? ?? ??? ?????

????????? ????? ?????

??? ??? ???? ??? ?? ??????? ASP ??? ?????? ?? ????????? ????? ????? ???, ?? ????? ????? ?? ???? ????:
  1. ??? ?????????? ??, ??? ????? ???????????? ????????????, ?? ???? ????????.
  2. ????????????? ????? ???, ????? ????html????????????? ????? ????, ?? ???? ???OK.
  3. ??? ??? ?? ??????? ??? ???????? ????? ???, ????? ???????:??? ????? ?????? ???
  4. ?? ??? ????, ?? ?? ??? ??? ??? ??? HTML ??? ?? ????????
  5. ???? ???? ?? ??? ??? ??? ????? HTML ??? ?? ????????
    <% @language="vbscript" %>
    <html>
    <head><title>Nonsecure Page</title></head>
    <body>
    <h3>Nonsecure Page</h3>
    <p>You are logged on as: 
    <%
      If Len(Session("UID")) = 0 Then
        Response.Write "<b>You are not logged on.</b>"
      Else
        Response.Write "<b>" & Session("UID") & "</b>"
      End If
    %>
    </p>
    <p><a href="default.asp">Back to default</a></p>
    </body>
    </html>
  6. ????? ?? ??? ??? ??????nonsecure.asp??? ??????? ??? ???? ????? ??? ???? ???
  7. ????? ???????????? ??,??? ????nonsecure.asp ??? ??? ?? ??? ?????

???????? ??? ?????

????? ?? ??? ??? ??, ????? ??? ???? ?? ????????? ??? ??? ?? ??? ??? ?? ?????? ?? ??? ????? ?? ????? ?? ??? ????? ??? ?? ?????? ????:
<!--#include virtual="/logon/_private/logon.inc"-->
?? ?? ???? ASP ????? ?? ??? ??? ?? ?? ?????? ?? ?????? ???, ?? ????? ?? ?? ????? logon.inc ????? ?? ?????? ??????? ?????? ???????? ?? ????? ??????? ?????? ???????? ?? ?? ??? ??? ????? ???, ?? ????? ????? ?? ???? ????:
  1. ??? ?????????? ??, ??? ????? ???????????? ????????????, ?? ???? ????????.
  2. ????????????? ????? ???, ????? ????html????????????? ????? ????, ?? ???? ???OK.
  3. ??? ??? ?? ??????? ??? ???????? ????? ???, ????? ???????:??? ????? ?????? ???
  4. ?? ??? ????, ?? ?? ??? ??? ??? ??? HTML ??? ?? ????????
  5. ???? ???? ?? ??? ??? ??? ????? HTML ??? ?? ????????
    <% @language="vbscript" %>
    <!--#include virtual="/logon/_private/logon.inc"-->
    <html>
    <head><title>Password-Protected Page</title></head>
    <body>
    <h3>Password-Protected Page</h3>
    <p>You are logged on as: 
    <%
      If Len(Session("UID")) = 0 Then
        Response.Write "<b>You are not logged on.</b>"
      Else
        Response.Write "<b>" & Session("UID") & "</b>"
      End If
    %>
    </p>
    <p><a href="default.asp">Back to default</a>
    </body>
    </html>
  6. ????? ?? ??? ??? ??????passwordprotect.asp??? ??????? ??? ???? ????? ??? ???? ???
  7. ????? ???????????? ??,??? ????passwordprotect.asp ??? ??? ?? ??? ?????

????? ????? ?????

?? ????? ????? ????? ??????? Windows ????? ????? ????? ?? ?? ???? ???? ??? ???? ?????????? ??? ?? ??????? ???? ???? ?? ??? ?? ????? ?? ??? ???????? ??? ??? ?? ??????? ?? ?????? ???? ???? ???????????? ???? ???? ???? ????? ?? ??? ?? ????? ?????, ?? ????? ?? ???? ????:
  1. ??? ?????????? ??, ??? ????? ???????????? ????????????, ?? ???? ????????.
  2. ????????????? ????? ???, ????? ????html????????????? ????? ????, ?? ???? ???OK.
  3. ??? ??? ?? ??????? ??? ???????? ????? ???, ????? ???????:??? ????? ?????? ???
  4. ?? ??? ????, ?? ?? ??? ??? ??? ??? HTML ??? ?? ????????
  5. ???? ???? ?? ??? ??? ??? ????? HTML ??? ?? ????????
    <% @language="vbscript" %>
    <!--#include virtual="/logon/_private/logon.inc"-->
    <%
      ' Was this page posted to?
      If UCase(Request.ServerVariables("HTTP_METHOD")) = "POST" Then
        ' If so, check the username/password that was entered.
        If ComparePassword(Request("UID"),Request("PWD")) Then
          ' If comparison was good, store the user name...
          Session("UID") = Request("UID")
          ' ...and redirect back to the original page.
          Response.Redirect Session("REFERRER")
        End If
      End If
    %>
    <html>
    <head><title>Logon Page</title>
    <style>
    body  { font-family: arial, helvetica }
    table { background-color: #cccccc; font-size: 9pt; padding: 3px }
    td    { color: #000000; background-color: #cccccc; border-width: 0px }
    th    { color: #ffffff; background-color: #0000cc; border-width: 0px }
    </style>
    </head>
    <body bgcolor="#000000" text="#ffffff">
    <h3 align="center">&#xa0;</h3>
    <div align="center"><center>
    <form action="<%=LOGON_PAGE%>" method="POST">
    <table border="2" cellpadding="2" cellspacing="2">
      <tr>
        <th colspan="4" align="left">Enter User Name and Password</th>
      </tr>
      <tr>
        <td>&#xa0;</td>
        <td colspan="2" align="left">Please type your user name and password.</td>
        <td>&#xa0;</td>
      </tr>
      <tr>
        <td>&#xa0;</td>
        <td align="left">Site</td>
        <td align="left"><%=Request.ServerVariables("SERVER_NAME")%> &#xa0;</td>
        <td>&#xa0;</td>
      </tr>
      <tr>
        <td>&#xa0;</td>
        <td align="left">User Name</td>
        <td align="left"><input name="UID" type="text" size="20"></td>
        <td>&#xa0;</td>
      </tr>
      <tr>
        <td>&#xa0;</td>
        <td align="left">Password</td>
        <td align="left"><input name="PWD" type="password" size="20"></td>
        <td>&#xa0;</td>
      </tr>
      <tr>
        <td>&#xa0;</td>
        <td colspan="2" align="center"><input type="submit" value="LOGON"></td>
        <td>&#xa0;</td>
      </tr>
    </table>
    </form>
    </center></div>
    </body>
    </html>
  6. ????? ?? ??? ??? ??????Logon.asp??? ??????? ??? ???? ????? ??? ???? ???
  7. ????? ???????????? ??,??? ????logon.asp ??? ??? ?? ??? ?????

????? ????? ????? ????? ????

???????? ????? ?? ?????????? ??? ?? ??????? ??????????? ???? ??? ?? ???????? ??? ??? ?? ????? ??? ??? ?? ?????? ????? ???? ?? ???? ??? ????? ????? ?? ??? ????? ????? ??, ????? ????? ?? ???? ????:
  1. ??? ??????? ??????????, ??? ????? ???????????? ????????????, ?? ???? ????????.
  2. ????????????? ????? ???, ????? ????html????????????? ????? ????, ?? ???? ???OK.
  3. ??? ??? ?? ??????? ??? ???????? ????? ???, ????? ???????:??? ????? ?????? ???
  4. ?? ??? ????, ?? ?? ??? ??? ??? ??? HTML ??? ?? ????????
  5. ???? ???? ?? ??? ??? ??? ????? HTML ??? ?? ????????
    <%
      ' Do not cache this page.
      Response.CacheControl = "no-cache"
    
      ' Define the name of the users table.
      Const USERS_TABLE  = "tblUsers"
      ' Define the path to the logon page.
      Const LOGON_PAGE   = "/logon/logon.asp"
      ' Define the path to the logon database.
      Const MDB_URL      = "/logon/_private/logon.mdb"
    
      ' Check to see whether you have a current user name.
      If Len(Session("UID")) = 0 Then
        ' Are you currently on the logon page?
        If LCase(LOGON_PAGE) <> LCase(Request.ServerVariables("URL")) Then
          ' If not, set a session variable for the page that made the request...
          Session("REFERRER") = Request.ServerVariables("URL")
          ' ...and redirect to the logon page.
          Response.Redirect LOGON_PAGE
        End If
      End If
    
      ' This function checks for a username/password combination.
      Function ComparePassword(UID,PWD)
        ' Define your variables.
        Dim strSQL, objCN, objRS
        ' Set up your SQL string.
        strSQL = "SELECT * FROM " & USERS_TABLE & _
          " WHERE (UID='" & ParseText(UID) & _
          "' AND PWD='" & ParseText(PWD) & "');"
        ' Create a database connection object.
        Set objCN = Server.CreateObject("ADODB.Connection")
        ' Open the database connection object.
        objCN.Open "driver={Microsoft Access Driver (*.mdb)}; dbq=" & _
          Server.MapPath(MDB_URL) & "; uid=admin; pwd="
        ' Run the database query.
        Set objRS = objCN.Execute(strSQL)
        ' Set the status to true/false for the database lookup.
        ComparePassword = Not(objRS.EOF)
        ' Close your database objects.
        Set objRS = Nothing
        Set objCN = Nothing
      End Function
    
      ' This function restricts text to alpha-numeric data only.
      Function ParseText(TXT)
        Dim intPos, strText, intText
        For intPos = 1 TO Len(TXT)
          intText = Asc(Mid(TXT,intPos,1))
          If (intText > 47 And intText < 58) Or _
             (intText > 64 And intText < 91) Or _
             (intText > 96 And intText < 123) Then
              strText = strText & Mid(TXT,intPos,1)
          End if
        Next
        ParseText = strText
      End Function
    %>
  6. ????? ?? ??? ??? ??????Logon.inc???? ????? ??? ???? ?? _private ???????
  7. ????? ???????????? ??,??? ????logon.inc ??? ??? ?? ??? ?????

????? ??? ???? ?? ???? ????

??? ???? ?? ???, ????? ????? ?? ???? ????::
  1. ??? ?????????? ??, ??? ???? ?????Default.asp??????????? ???????, ?? ???? ?????????? ??? ??????????? ????.

    ??? ??????? ????? ??? ????? ?? ??? ???? ?? ?? ?????? ?? ?? ?? ??? ?? ???? ????
  2. ????? ????????????? ?????????.

    ????? ??? ?? ???? ?? ?? ?????? ?? ?? ?? ??? ?? ???? ???? ????? ??????????? ?? ???????????? ????? ?? ???? ???? ?? ??? ???? ?????
  3. ????? ???????????-???????? ?????????.

    ???????? ??? ?? ???? logon.asp ????? ??? ???? ???
  4. ??????????????? ?? ???????? ???,testuser??????:???????????????????????? ???, ?? ???? ????????.

    ???????? ????? ????? ?? ?? ?? ?? ??? ?? ??? ?? ??? ??? ?????? ??testuser. ????? ??????????? ?? ???????????? ????? ?? ???? ???? ?? ??? ???? ????? ??? ????? ??? ?? ???? ?? ?? ?? ?? ??? ?? ??? ?? ??? ??? ?????? ??testuser.
  5. ????? ????????????? ?????????.

    ????? ??? ?? ???? ?? ?? ?? ?? ??? ?? ??? ?? ??? ??? ?????? ??testuser.

????? ??? ???? ?? ???????? ????

?? ????? ?????? ??? ???? ?? ????? ?????? ???????? ?? ???? ???:
  • ?????????? ??? ?? ??????? ?? ?????:
    ?? ?????????? ??? ??? ??????? ?? ????? ?? ???? ???, ?? ???? ??? ???????????? ?? ?????tblUsers?????? ???
  • ??????? ?????? ???????? ??? ????? ???? ?????:
    ????? ?? ??? ???? ??? ???? ??? ??????? ?????? ???????? ?? ?? ???? ???? ??? ???, ???? ?????? ????? ??? ??????. asp ????? ??? ?????????, ???? ?? ????? ??Mypage.asp, ?? ???? ??? ????? ?? ????????? ??? ????? ???? ??? ??????:
    <% @language="vbscript" %>
    <!--#include virtual="/logon/_private/logon.inc"-->
    ????? ?????? ????????? ???? ?? ?? ?? ???? ???????????? ???? ?? ??? Microsoft Visual Basic ???????????? ??????? (VBScript) ?? ????? ?? ??? ???? ????? ?????? ?? ?????????? ?? ??? ????? ???, ?? ?? ??? ?? ??????? ??????????? ????? ???? ???? ???? ???? ????? ???

??????

FrontPage 2003, ?????? ????? ?????, ?? ???? Access ??????? ?? ????? ???? ??????? ?????? ???????? ?? ?? ??? ??? ????? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? Microsoft ???????? ??? ???? ????? ?? ??? ????? ???? ?????? ?? ????? ????:
825498FrontPage 2003, ?????? ????? ?????, ?? ???? Access ??????? ?? ????? ???? ???????-???????? ??? ??? ?? ????? ?? ??? ???? ????

??????? ?? ????? ?? ??? HTTP ????? ?? ???????? ???? ??? ??? ???? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? ?????? ?? Microsoft ???????? ??? ????? ?? ??? ????? ???? ???????? ?? ????? ????:
299525IIS 5.0 ?? ?????????? ????? 2.0 ?? ????? ???? SSL ??? ???? ?? ??? ???? ????
299875IIS ??? SSL ?? ??????????? ???? ?? ??? ???? ????

??????? ?? ??? ?????? ????? ????? (ASP) ?? ?????? ???? ?? ??? ???? ???? ?? ???? ??? ???? ??????? ?? ??? ?????? ?? Microsoft ???????? ??? ????? ?? ??? ????? ???? ???????? ?? ????? ????:
299987ASP ??????? ?? ??????????? ???? ?? ??? ??????? ?? ASP ???? ?? ????? ???? ????
300382IIS ??? ?? ASP ??? ?? ??? ??????? ??????? ?? ????? ?? ??? ???? ????
318287???? ???? FrontPage 2002 ??? ?????? ????? ????? (ASP) ?? ????? ???? ?? ???

???

???? ID: 928706 - ????? ???????: 06 ?????? 2010 - ??????: 2.0
???? ???? ???? ??:
  • Microsoft Expression Web
??????: 
kbexpertiseinter kbhowto kbmt KB928706 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:928706

??????????? ???

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com