After a long period of search I decide to ask my own question about my problem.
I try to get the value of a Property in Active Directory, but I always get a System.__ComObject.
correspondance += compte.Properties["ENTPersonDateNaissance"][0];
I have tried to use :
Microsoft.VisualBasic.Information.TypeName(compte.Properties["ENTPersonDateNaissance"]
The result is PropertyValueCollection
But I don't know how to get the value?
In fact, the variable "compte" is of type DirectoryEntry, I switched it to SearchResult, and now I can access it value with :
compte.Properties["ENTPersonDateNaissance"][0].ToString()
I hope it can help.
来源:https://stackoverflow.com/questions/29819458/how-to-get-a-system-comobject-value-from-active-directory-in-c-sharp