HOW TO:設定 System.DirectoryServices 的開發環境

本主題描述如何設定 System.DirectoryServices 的 Microsoft .NET Framework 專案。

使用 System.DirectoryServices

  1. 啟動 Visual Studio。

  2. 按一下 [檔案 > 新增 > 專案]。

  3. 在 [專案類型] 欄位中,按一下專案類型 ([C#] 或 [Visual Basic])。

  4. 在 [範本] 欄位中,按一下專案範本 ([主控台應用程式] 或 [Windows 應用程式])。

  5. 命名專案。

  6. 按一下 [確定] 建立新專案。

  7. 按一下 [專案 > 加入參考]。

  8. 在 [加入參考] 對話方塊中,從清單中選取 [System.DirectoryServices.dll]。

  9. 按一下 [確定] 以加入參考。

  10. 將下行加入至程式碼。

    Imports System.DirectoryServices
    
    Using System.DirectoryServices;
    

如果未加入 using 陳述式或 Imports 陳述式,則在參考那些物件時,應用程式必須在 System.DirectoryServices 命名空間中使用物件的完整名稱。例如,若要參考 DirectoryEntry 物件,則應該將它格式化如下:System.DirectoryServices.DirectoryEntry。在 Visual Basic 和 C# 中,完整名稱的格式都相同。

請參閱

工作

HOW TO:建立簡單 System.DirectoryServices 應用程式

參考

System.DirectoryServices

概念

System.DirectoryServices 使用者入門

Send comments about this topic to Microsoft.

Copyright © 2007 by Microsoft Corporation.All rights reserved.