ldap ldap_get_values

lc47517680 2012-09-21 11:24:07
当遇到属性同名的时候 比如一个DN属性可以有多个objectclass
我通过ldap_get_values 这个函数只能获得其中一个objectclass 的值.
大家是怎么解决的.
...全文
153 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
tim_cool 2012-09-21
  • 打赏
  • 举报
回复

vals = ldap_get_values( ld_, msg_entry, item );
int val_count = ldap_count_values(vals);
for (int k=0; k<val_count; k++)
{
char* value = vals[k];
}
冷月清晖 2012-09-21
  • 打赏
  • 举报
回复
你仔细看看函数说明:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa366935(v=vs.85).aspx

Return value
If the function succeeds, it returns a null-terminated list of pointers to values. If no attribute values were found, it usually returns NULL. But in some cases it may return a list one pointer that is NULL. Always make sure to use ldap_count_values to get the count of values in the returned list, as noted in Remarks. The session error parameter in the LDAP data structure is set to 0 in either case.
If the function fails, it returns NULL and the session error parameter in the LDAP data structure is set to the LDAP error code.


返回的本来就是list of pointers

3,882

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧