I was enumerating a collection and printing the value of
each data item when I noticed that some of the objects in
the collection returned "System.Obj ect[]" from
their .ToString() method.
Assuming that they aren't literally strings with the
value "System.Obj ect[]", how can I convert one of these
objects to an object array? Reflection?
Convert.ChangeT ype?
My code:
DirectoryEntry parent = new DirectoryEntry
(@"LDAP://RootDSE");
IEnumerator bob =
parent.Properti es.PropertyName s.GetEnumerator ();
while(bob.MoveN ext()){
if(parent.Prope rties[bob.Current.ToS tring
()].Value.GetType( ).IsArray){
Response.Write( "my array: " + parent.Properti es
[bob.Current.ToS tring()].Value.ToString ());
}
}
JER
each data item when I noticed that some of the objects in
the collection returned "System.Obj ect[]" from
their .ToString() method.
Assuming that they aren't literally strings with the
value "System.Obj ect[]", how can I convert one of these
objects to an object array? Reflection?
Convert.ChangeT ype?
My code:
DirectoryEntry parent = new DirectoryEntry
(@"LDAP://RootDSE");
IEnumerator bob =
parent.Properti es.PropertyName s.GetEnumerator ();
while(bob.MoveN ext()){
if(parent.Prope rties[bob.Current.ToS tring
()].Value.GetType( ).IsArray){
Response.Write( "my array: " + parent.Properti es
[bob.Current.ToS tring()].Value.ToString ());
}
}
JER
Comment