在web.config 中保存用户名和密码

目前做了一个的网站,只需要一个用户也就是管理员,我想直接将用户名和密码存储在web.config的credentials节点中。

System.Web.Security.FormsAuthentication 这个类可以验证credentials节点中的用户和密码。但是我还想实现在程序中动态修改密码的功能,该怎么实现呢


喵喔喔
浏览 1073回答 2
2回答

慕哥9229398

剩下的就是查找配置节,读取配置节的问题了。 // running on the local server.  System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration("/system.web/authentication/...")  as System.Configuration.Configuration;
打开App,查看更多内容
随时随地看视频慕课网APP