Friday, August 07, 2009 3:27 PM Vimpyboy

SPLibrary – A SharePoint Library on a CodePlex near you

I have just released SPLibrary, a SharePoint Library written in C# on CodePlex. It works with the SharePoint web services and do not have to run on the same server as SharePoint.

Examples

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

 

You can find more information and the source code here:

http://splibrary.codeplex.com/

Filed under: , ,

Comments

# SPLibrary ??? A SharePoint Library on a CodePlex near you | ASP Scribe

Pingback from  SPLibrary ??? A SharePoint Library on a CodePlex near you | ASP Scribe

# re: SPLibrary – A SharePoint Library on a CodePlex near you

Friday, August 07, 2009 11:29 AM by mpeterson

Neat... can this be used to add new rows to an existing list?

# re: SPLibrary – A SharePoint Library on a CodePlex near you

Saturday, August 08, 2009 2:16 AM by Vimpyboy

Hi,

You can only use this for listing so far.

/Mikael Söderström

# Links (8/9/2009) &laquo; Steve Pietrek &#8211; Everything SharePoint

Pingback from  Links (8/9/2009) &laquo; Steve Pietrek &#8211; Everything SharePoint

Leave a Comment

(required) 
(required) 
(optional)
(required)