次の方法で共有


Boolean プロパティ型

Active Directory ドメイン サービス スキーマの Boolean 構文型は、isDefunct 属性や isDeleted 属性などのプロパティに使用されます。System.DirectoryServices は、この構文型を Boolean 値として処理します。ADSI では、このプロパティ型は ADSTYPE_BOOLEAN として識別されます。ADSTYPE_BOOLEAN の詳細については、MSDN ライブラリ (https://go.microsoft.com/fwlink/?LinkID=27252) で ADSTYPEENUM 列挙に関するドキュメントを参照してください。Boolean 構文、isDefunct 属性、または isDeleted 属性の詳細については、MSDN ライブラリ (https://go.microsoft.com/fwlink/?LinkID=27252) で Boolean 構文、Is-Defunct 属性、または Is-Deleted 属性に関するトピックを参照してください。

次の例は、Boolean 値を持つプロパティを読み取る方法を示しています。

Console.WriteLine(usr.Properties("isDeleted").Value)
Console.WriteLine(usr.Properties["isDeleted"].Value);

次のコード例は、単一の値を持つ Boolean プロパティを true に設定する方法を示しています。

usr.Properties("isDeleted").Value = True
usr.CommitChanges()
usr.Properties["isDeleted"].Value = true;
usr.CommitChanges();

次の例は、複数の値を持つ Boolean プロパティに true という値を追加する方法を示しています。

usr.Properties("isDeleted").Add(True)
usr.CommitChanges()
usr.Properties["isDeleted"].Add(true);
usr.CommitChanges();

関連項目

リファレンス

System.DirectoryServices
Boolean

概念

プロパティの型

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation. All rights reserved.