stsy.asp文件如下<html>   
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<STYLE TYPE="text/css">
    <!--
    body { font-family: Arial, Helvetica, sans-serif, Verdana; margin-left:0; margin-right:0; margin-top:0; margin-bottom:0; }
    input  { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; }
    select { margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; }
    a { color:#0033CC; text-decoration:none }
    a:hover, a:active { color:#0033CC; text-decoration:underline }
    -->
</STYLE>
<title>abcd</title>
</head>
<body  bgcolor="#FFFFFF"  link="#0033CC" alink="#0033CC" vlink="#0033CC">
<form name = prtsvrbasicInfo  method="POST" action=/goform/form_prtsvrbasicInfoSet>
<b>EWS Settings</b>
<table bgcolor="#FFFFFF" border=1 cellspacing=0 cellpadding=0 width=100%><tr><td>
<table bgcolor="#FFFFFF" border=0 cellspacing=0 cellpadding=4 width=100%>
<tr>
    <td width=50% nowrap><b><font size=-1>Auto Refresh</font></b></td>
    <%WebGetServerEWSSetting(0, 1);%>
</tr>
<tr>
    <td width=50% nowrap><b><font size=-1>Auto Refresh Interval</font></b></td>
    <%WebGetServerEWSSetting(1, 1);%>
</tr>
</table>
</td></tr></table>
<br>
<table border="0" cellpadding="8" cellspacing="0" align="center"><tr>
    <td><input type="submit" value="Apply New Settings" ></td>
    <td><input type="reset"  value="Restore Settings"></td>
</tr>
</table>
</form>
</td></tr></table>
</body>
</html>请问利用怎样利用WWW-Authenticate,在点击Apply New Settings后弹出登陆认证框(点击Apply New Settings时条用的后台函数是form_prtsvrbasicInfoSet)

解决方案 »

  1.   

    IIS6的话<%
        Response.Buffer = True
        Response.Clear
        Dim Myname, MyPass
        GetUser Myname, MyPass
     
        'Response.Write MyName & "->" & MyPass
     
        if len(Myname) = 0 Then
            Response.Status = "401 Unauthorized"
            Response.AddHeader "WWW-Authenticate","BASIC Realm=enter your realm here"
            Response.End
        End if    Call form_prtsvrbasicInfoSet()
     
    Sub GetUser(ByRef LOGON_USER, ByRef LOGON_PASSWORD)
        LOGON_USER = Request.ServerVariables("AUTH_USER")
        LOGON_PASSWORD = Request.ServerVariables("AUTH_PASSWORD")
    End Sub
    %>
      

  2.   

    我还想问下,这部分vbscript的代码是不是放在head中间,因为该文件还有javascript的代码,会不会有什么冲突,没太用过这方面,不是很懂。
    还有,需要对点击Apply new setting 时做响应处理嘛?上面的是不是就已经可以实现了?
    谢谢!
      

  3.   

    哦,还有,是必须要装IIS才能用吗?
      

  4.   

    asp脚本是在服务器端运行的,服务器端的脚本和客户端的脚本没关系
    必须装IIS 
      

  5.   

    可是现已经有了服务器了,用的是Goahead,好像已经包含了IIS了,所以应该不用装了吧