Webconfiguration中基本authentication的语法

我想添加一个密码保护一个目录,但我只find没有密码的以下代码

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <directoryBrowse enabled="true" /> </system.webServer> <system.web> <authentication mode="Windows" /> <authorization> <allow users="test" /> </authorization> </system.web> </configuration> 

我如何添加用户“testing”的密码?

谢谢

您现在可能已经find了答案,但您需要做的是使用用户名testing在Windows服务器上创build本地用户,然后将相关密码分配给该用户。 IIS将把input的凭证映射到本地Windows,并将根据该Windows用户的凭据validation凭据。 希望有所帮助。