If you don't want to add additional dependencies and just want to parse the string..
This type of string can easily be parsed just using string.Split. To get the CN values, would be something like..
string[] split = "CN=Foo Group Name,DC=mydomain,DC=com".Split(',');
List<string> cnValues = new List<string>();
foreach(string pair in split){
string[] keyValue=pair.Split('=');
if(keyValue[0]=="CN")
cnValues.Add(keyValue[1]);
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…