In my Web.Config file, I have
<identity userName="CTX_DOMAIN\ldapuser" password="ldapPW" />
开发者_如何学JAVAHow can I pull these userName and password strings in my C# behind code?
This should work:
System.Web.Configuration.IdentitySection identityInfo = (System.Web.Configuration.IdentitySection)ConfigurationManager.GetSection("system.web/identity");
string userName = identityInfo.UserName;
string password = identityInfo.Password;
精彩评论