Visual C # Building Network computer tree

Source: Internet
Author: User
Tags network function

Visual C # Writing network applications typically use the two important network namespace "System.Net" and "System.Net.Sockets" that are available in the. Net FrameWork SDK. In fact, Visual C # can also implement many useful network functions by invoking class libraries in other namespaces, the most common of which is "System.DirectoryServices", "System.DirectoryServices" Namespaces define the "DirectoryEntry" and "DirectorySearcher" classes that enable access to the Active Directory Service Interface (ADSI, for short). The Active Directory service interface provides an easy way to construct complex computer networks. The Active directory Service Interface System is arranged in a hierarchical tree structure. Each node represents a resource or service on the network (the domain or workgroup in the network), and this node contains a set of properties that can be retrieved and manipulated (the hosts in the corresponding network). This article is through them to achieve a more useful network function-to build a network composed of computer tree structure diagram.

A Active Directory Service Interfaces and DirectoryEntry classes

The Active Directory service interface is the programmatic interface for Microsoft Windows Active directory. It allows an application to interact with different directories on the network using a single interface. Visual C # is an easy access to this interface by creating DirectoryEntry and DirectorySearcher. This operation, for other programming languages, means that the WINAPI function needs to be invoked.

Active Directory Service Interfaces can do many things that this article implements to access the Active Directory tree to build a hierarchical tree-structured graph of the network configuration, just a small part of it. To use the Active Directory service interface, ADSI 2.5 or later must be installed on the client computer. Windows 2000 automatically installs ADSI 2.5, and for systems with win 98 and below, ADSI 2.5 is not installed, which is why the network feature that is described below does not get the system is the win 98 and the following operating systems correspond to the network tree. Therefore, one of the prerequisites for successfully building a network of network functions described below is that the operating system of the computer on the network is tree 2000 and above.

Since only the DirectoryEntry class is used in this article, only the structure and usage of DirectoryEntry are introduced, and tables 01 and 02 are common properties, common methods, and descriptions of DirectoryEntry classes:

/tr>
description
authenticationtype
children get Directo Ryentries instance, which contains active
Gets the name of the object named with the underlying directory service.
nativeobject > get native A Ctive Directory Service Interface (ADSI) object.
parent get active Di The parent of this item in the rectory hierarchy.
password Get or set on the customer The password that is used when the end is authenticated.
path
properties
schemaclassname
schemaentry get dire Ctoryentry, which holds schema information for this item. The schema of the item determines the list of the names of its mandatory and optional attributes.
usepropertycache
username Get or set on the customer The user name to use when authenticating the end.

Common Properties of Table 01:directoryentry classes and their descriptions

/tr>
method description
close > Close DirectoryEntry and release the group Any system resources associated with the item.
commitchanges save to a ctive
copyto
deletetree from active Delete this item and its entire subtree in the directory hierarchy.
exists
invoke in native active D The method is called on the irectory.
moveto
refreshcache
rename

Common methods of table 02:directoryentry classes and their descriptions

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.