关于ChangePassword请大家帮忙,看看为什么会有这样的错误?
想用户可以改变自己的网络密码,但出现The Active Directory property cannot be found in the cache. 错误,到MSDN找了几天,没发现解决办法,请大家看看以下的程序:
//change password
public string ChangePassword(string username,string oldpwd,string newpwd)
{
string return_msm="";
string _path="LDAP://"+ domain;
string domainAndUsername = domain + @"\" + username;
DirectoryEntry entry = new DirectoryEntry( _path,
domainAndUsername,
oldpwd);
try
{
entry.Invoke("ChangePassword", new Object[] {oldpwd,newpwd});
entry.CommitChanges();
entry.RefreshCache();
return_msm = "OK";
}
catch (Exception ex)
{
return_msm=ex.Message;
}
return return_msm;
}