SPWeb.GetFolder method (String)

Gets the folder that is located at the specified URL.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function GetFolder ( _
    strUrl As String _
) As SPFolder
'Usage
Dim instance As SPWeb
Dim strUrl As String
Dim returnValue As SPFolder

returnValue = instance.GetFolder(strUrl)
public SPFolder GetFolder(
    string strUrl
)

Parameters

  • strUrl
    Type: System.String

    The server-relative URL for the folder.

Return value

Type: Microsoft.SharePoint.SPFolder
The specified folder.

Exceptions

Exception Condition
ArgumentNullException

strUrl is null .

Remarks

The user must have BrowseDirectories permission to use this method.

See also

Reference

SPWeb class

SPWeb members

GetFolder overload

Microsoft.SharePoint namespace