共用方式為


DateTime 屬性

Active Directory 網域服務結構描述使用 String(Generalized-Time) 與 String(UTC-Time) 語法類型來表示日期和時間資訊。如需 String(Generalized-Time) 與 String(UTC-Time) 語法類型的詳細資訊,請參閱 MSDN Library 中的<String(Generalized-Time)>或<String(UTC-Time)>,網址為:https://go.microsoft.com/fwlink/?LinkID=27252 (本頁面可能為英文)。

System.DirectoryServices 命名空間使用 DateTime 結構來表示這些資料型別。此屬性型別相當於 ADSI ADSTYPE_UTC_TIME 屬性型別。如需 ADSTYPE_UTC_TIME 屬性型別的詳細資訊,請參閱 MSDN Library 中的<ADSTYPEENUM>,網址為:https://go.microsoft.com/fwlink/?LinkID=27252 (本頁面可能為英文)。

下列範例示範如何在物件上寫入 DateTime 屬性。

DateTime newdt = new DateTime(2002, 10, 21, 11, 4, 5, 0);
de.Properties["TestTime"].Value = newdt;
de.CommitChanges();

請參閱

參考

System.DirectoryServices
DateTime

概念

屬性型別

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation.All rights reserved.