0
在我的web.config文件中,我有拉<identity>串
<identity userName="CTX_DOMAIN\ldapuser" password="ldapPW" />
我怎麼能拉後面的代碼我的C#這些userName和密碼字符串?
在我的web.config文件中,我有拉<identity>串
<identity userName="CTX_DOMAIN\ldapuser" password="ldapPW" />
我怎麼能拉後面的代碼我的C#這些userName和密碼字符串?
這應該工作:
System.Web.Configuration.IdentitySection identityInfo = (System.Web.Configuration.IdentitySection)ConfigurationManager.GetSection("system.web/identity");
string userName = identityInfo.UserName;
string password = identityInfo.Password;
的確!非常感謝你 :) – 2011-01-20 00:01:40