Project Description
A SharePoint library that uses the Web Services delivered by SharePoint. You can easily enter a URL to the SharePoint site and list sites, lists and items, search the site etc.

It´s written in C# and is compatible with .NET Framework 2.0 and later.

I started writing this library for test purposes, but it should be stable enough to use in production. If you intend to use it in production, make sure you cache so much as possible, such as sites, lists etc.

There can be some test code left, but that wont affect anything.

Examples

There is an included test project where you can test these, and other functions.

Get all sites
SPLibrary sp = new SPLibrary(new Uri("http://moss"), new NetworkCredential("user", "password", "domain"));
SPWeb[] webs = sp.GetWebs();

Get all lists for a site
SPLibrary sp = new SPLibrary(new Uri("http://moss"), new NetworkCredential("user", "password", "domain"));
SPList[] lists = sp.GetLists();

Get a specific list
SPLibrary sp = new SPLibrary(new Uri("http://moss"), new NetworkCredential("user", "password", "domain"));
SPSingleList list = sp.GetList("List ID (GUID)");

Get all items in a list
SPLibrary sp = new SPLibrary(new Uri("http://moss"), new NetworkCredential("user", "password", "domain"));
SPListItem[] listitems = sp.GetListItems("List ID (GUID)"); //All items
SPListItem[] listitems = sp.GetListItems("List ID (GUID)", Dictionary<string, string>); //Filtered

Search the site
SPLibrary sp = new SPLibrary(new Uri("http://moss"), new NetworkCredential("user", "password", "domain"));
SPSearchResult[] search = sp.Search(""); //6 different overloads for filtering

Last edited Aug 7, 2009 at 12:54 PM by Vimpyboy, version 4