SiteData.EnumerateFolder method

Returns information about the files and folders within a folder on a SharePoint site.

Namespace:  WebSvcSiteData
Assembly:  STSSOAP (in STSSOAP.dll)

Syntax

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

returnValue = instance.EnumerateFolder(strFolderUrl, _
    vUrls)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/EnumerateFolder", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public uint EnumerateFolder(
    string strFolderUrl,
    out _sFPUrl[] vUrls
)

Parameters

  • strFolderUrl
    Type: System.String

    A string that contains the site-relative URL of the folder.

  • vUrls
    Type: []

    Returns an array that contains information about the files and folders, including their URLs, the date and time that each item was last modified, and a Boolean value that specifies whether the item is a folder.

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 URL of each file in a folder, as well as the date and time that it 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 enArray() As Web_Reference_Name._sFPUrl

srvSiteData.EnumerateFolder("Doc_Lib/Folder", enArray)

Dim en As Web_Reference_Name._sFPUrl

For Each en In enArray

    If Not en.IsFolder Then

        label1.Text += en.Url.ToString() + " :: " + en.LastModified.ToString() + ControlChars.Lf

    End If

Next en
Web_Reference_Name.SiteData srvSiteData = new Web_Reference_Name.SiteData();
srvSiteData.Credentials = System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Name._sFPUrl[] enArray;

srvSiteData.EnumerateFolder("Doc_Lib/Folder", out enArray);

foreach (Web_Reference_Name._sFPUrl en in enArray)
{
    if (!en.IsFolder)
    {
        label1.Text += en.Url.ToString() + " :: " + en.LastModified.ToString() + "\n";
    }
}

See also

Reference

SiteData class

SiteData members

WebSvcSiteData namespace