I'm trying to read properties from DirectoryEntry
.
Unfortunately not all records have employeeNumber
property so I need to check if it exists.
I already tried:
a == one DirectoryEntry record
a.GetType().GetProperty("employeeNumber")==null //always returns true
String.IsNullOrWhiteSpace(a.Properties["employeeNumber"].ToString()) //exception
what else can I try?