Partilhar via


SiteData.GetListCollection Method

Returns information about all the lists in the current SharePoint site.

Namespace:  [SiteData Web service]
Web service reference: http://Site/_vti_bin/SiteData.asmx

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListCollection", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetListCollection ( _
    <OutAttribute> ByRef vLists As _sList() _
) As UInteger
'Usage
Dim instance As SiteData
Dim vLists As _sList()
Dim returnValue As UInteger

returnValue = instance.GetListCollection(vLists)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetListCollection", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public uint GetListCollection(
    out _sList[] vLists
)

Parameters

  • vLists
    Type: []

    A string that returns an array that contains information about the lists.

Return Value

Type: System.UInt32
A 32-bit unsigned integer that returns 0 to indicate that the operation has completed.

Examples

The following code example displays the title of each list, the URL of the default view for each list, and the date and time when each list was last modified. This example assumes the existence of a label within the form of a Windows Application.

Dim srvSiteData As New Web_Reference_Name.SiteData()
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim lists() As Web_Reference_Name._sList

srvSiteData.GetListCollection(lists)

Dim list As Web_Reference_Name._sList

For Each list In lists
    label1.Text += list.Title & " :: " & _
        list.DefaultViewUrl & " :: " & _
        list.LastModified.ToString() & _
        ControlChars.Lf
Next list
Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Name._sList[] lists;

srvSiteData.GetListCollection(out lists);

foreach (Web_Reference_Name._sList list in lists)
{
    label1.Text += list.Title + " :: " + list.DefaultViewUrl + " :: " + 
      list.LastModified.ToString() + "\n";
}

See Also

Reference

SiteData Class

SiteData Members

SiteData Web Service