2016-08-08 16 views
0

Also überschreibe ich ein Programm von VB zu C# und renne in einige schwierige DirectoryServices. In VB sieht der Code so aus wieResultPropertyCollection enthält keine Definition für Item. C#

Dim myResultPropertyValueCollection As ResultPropertyValueCollection = myResultPropertyCollection.Item(FieldName) 

Wie kann ich die C# gleichwertig erhalten? In C# versuche ich

ResultPropertyValueCollection resultPropertyValueCollection = resultPropertyCollection.Item(fieldName); 

aber ich eine Störung erhalte die besagt, dass ResultPropertyCollection keine Definition für den Posten enthält.

danke

Antwort

0

Nevermind ich fand es.

ResultPropertyValueCollection resultPropertyValueCollection = resultPropertyCollection[fieldName];