Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

SPUtility.GetUrlDirectory method

Returns the directory-path part of the URL.

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

public static string GetUrlDirectory(
	string url
)

Parameters

url
Type: System.String

The URL path.

Return value

Type: System.String
A string that contains the directory path of the URL.

If the url parameter is http://server/web/list/folder/file.txt, the returned directory part is "http://server/web/list/folder".

Show:
© 2015 Microsoft