1

私の問題は、LDAPconnectionクラスを使用してSSL経由で接続していることです。nTSecurityDescriptor値を取得できましたが、エラーが発生します

System.Byte[]のオブジェクトをActiveDs.IADsSecurityDescriptorにキャストできません」

私はこのようなコードを使用しています

SearchResponse response = (SearchResponse)connection.SendRequest(request);
IADsSecurityDescriptor sd = (IADsSecurityDescriptor)response.Entries[0].Attributes["nTSecurityDescriptor"][0];

これを行うためのエラーまたは他の方法はありますか?

4

1 に答える 1

2

ついに私は私の質問の答えを見つけます。このクラスは、byte[] を有効なセキュリティ記述子 comobject に変換します。

ActiveDs.ADsSecurityUtility secUtility = new ActiveDs.ADsSecurityUtility();
ActiveDs.IADsSecurityDescriptor sd = (IADsSecurityDescriptor)secUtility.ConvertSecurityDescriptor((byte[])attribute[0], (int)ADS_SD_FORMAT_ENUM.ADS_SD_FORMAT_RAW, (int)ADS_SD_FORMAT_ENUM.ADS_SD_FORMAT_IID);
于 2012-12-14T06:08:16.927 に答える