DirectoryVirtualListView Class
The DirectoryVirtualListView class specifies how to conduct a virtual list view search. A virtual list view search enables users to view search results as address-book style virtual list views. It is specifically designed for very large result sets. Search data is retrieved in contiguous subsets of a sorted directory search.
Assembly: System.DirectoryServices (in System.DirectoryServices.dll)
The following C# example shows how to retrieve the first 30 entries in a result set.
using System.DirectoryServices; ... DirectorySearcher src = new DirectorySearcher("…"); src.VirtualListView = new DirectoryVirtualListView(0,30); foreach(SearchResult res in src.FindAll() ) { Console.WriteLine(…"); }
The following C# example shows how to retrieve the first 50 entries in a result set that start with the letters "Ha".
using System.DirectoryServices; ... DirectorySearcher src = new DirectorySearcher("…"); src.VirtualListView = new DirectoryVirtualListView(0,50, "Ha"); foreach(SearchResult res in src.FindAll() ) { Console.WriteLine(…"); }
The following C# example shows how to retrieve the first 100 entries at the 60% approximate target.
using System.DirectoryServices; ... // First VLV calls. DirectorySearcher src = new DirectorySearcher("…"); src.VirtualListView = new DirectoryVirtualListView(100); foreach(SearchResult res in src.FindAll() ) { Console.WriteLine(…"); } // Second Call, the VLV context is still attached to the DirectorySearcher. src.VirtualListView.TargetPercentage = 60; src.VirtualListView.BeforeCount = 50; src.VirtualListView.AfterCount = 50; foreach(SearchResult res in src.FindAll() ) { Console.WriteLine(…"); }
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.