2

经过长时间的搜索,我决定就我的问题提出自己的问题。

我尝试在 Active Directory 中获取属性的值,但我总是得到一个System.__ComObject

correspondance += compte.Properties["ENTPersonDateNaissance"][0];

我试过使用:

 Microsoft.VisualBasic.Information.TypeName(compte.Properties["ENTPersonDateNaissance"]

结果是PropertyValueCollection

但我不知道如何获得价值?

4

1 回答 1

2

实际上,变量“compte”的类型是 DirectoryEntry,我将其切换为 SearchResult,现在我可以使用以下命令访问它的值:

compte.Properties["ENTPersonDateNaissance"][0].ToString()

我希望它可以帮助。

于 2015-05-05T07:26:06.420 回答