2
我有我在web.config中使用窗體身份驗證和存儲每個用戶名/密碼,一個很簡單的asp.net應用程序:web.config中的窗體身份驗證得到所有用戶
<authentication mode="Forms">
<forms name="appNameAuth" path="/" loginUrl="l.aspx" protection="All" timeout="600">
<credentials passwordFormat="Clear">
<user name="user1" password="pass1"/>
<user name="user2" password="pass2"/>
<user name="user3" password="pass3"/>
</credentials>
</forms>
</authentication>
我會喜歡簡單地獲取所有用戶,然後將其綁定到下拉列表。
感謝。我遇到了麻煩,因爲它從我的根web.config中拉出。 – dave2118 2011-04-26 13:48:30
你應該使用這個來打開請求的web.config表單配置: FormsAuthenticationConfiguration formsAuthentication =((AuthenticationSection)WebConfigurationManager.OpenWebConfiguration(「〜」)。GetSection(「system.web/authentication」))。Forms ;' – Myobis 2015-11-18 21:28:11