共用方式為


布林值屬性型別

Active Directory 網域服務結構描述布林值語法類型可用於如 isDefunct 與 isDeleted 的屬性。System.DirectoryServices 將此語法類型視為 Boolean 值。在 ADSI 中,此屬性類型以 ADSTYPE_BOOLEAN 識別。如需 ADSTYPE_BOOLEAN 的詳細資訊,請參閱 MSDN Library 中的 ADSTYPEENUM 列舉文件,網址為:https://go.microsoft.com/fwlink/?LinkID=27252 (本頁面可能為英文)。如需布林值語法、isDefunct 屬性或 isDeleted 屬性的詳細資訊,請參閱 MSDN Library 中的<布林值語法>、<Is-Defunct 屬性>或<Is-Deleted 屬性>,網址為:https://go.microsoft.com/fwlink/?LinkID=27252 (本頁面可能為英文)。

下列範例示範如何讀取具有布林值的屬性。

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

下列程式碼範例示範如何將單值布林值屬性設定為 true

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

下列範例示範如何將將 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.