Home > DeveloperSection > Forums > Pulling <identity> strings
Ankit Singh

Total Post:341

Points:2389
Posted on    August-23-2014 7:25 AM

 ASP.Net ASP.Net 
Ratings:


 1 Reply(s)
 827  View(s)
Rate this:

In my Web.Config file, I have

<identity userName="CTX_DOMAIN\ldapuser" password="ldapPW" />

How can I pull these userName and password strings in my C# behind code?



Sumit Kesarwani

Total Post:378

Points:2694
Supported
Posted on    August-23-2014 8:55 AM

Hi Ankit,

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; 



Don't want to miss updates? Please click the below button!

Follow MindStick