SPUtility Members
Include Protected Members
Include Inherited Members
Provides tools for converting date and time formats, for obtaining information from user names, for modifying access to sites, and for various other tasks in managing deployments of Microsoft SharePoint Foundation.
The SPUtility type exposes the following members.
Properties
Name | Description | |
---|---|---|
DeveloperDashboardIsEnabled | Gets the developer dashboard enabled-status for the current request. | |
OriginalServerRelativeRequestPath | ||
OriginalServerRelativeRequestUrl | Gets the original URL after the Microsoft SharePoint Foundation server has re-written it. |
Top
Methods
Name | Description | |
---|---|---|
AddCellStoragePartition | Adds a new partition mapping for an application to execute cell storage operations. | |
AddDefaultWikiContent | Initializes a wiki library with welcome and help content and sets the root folder welcome name for the list. | |
AllItemsQuery | Obsolete. | |
AlternateServerUrlFromHttpRequestUrl | Returns the outgoing URL for the alternate request URL represented by the specified URI. | |
AutoHyperlinking | Converts URLs and email addresses in a plain text string into hyperlinks in an HTML-encoded string. | |
BinarySearchWithFallback<T> | Performs a binary search of a list for a generic object. If the object is not found in the list, this method finds the zero-based index location in the list at which the generic object should be inserted. | |
ChangeAccountPassword | Changes an account password for the specified SharePoint site. | |
CheckForCustomToolpane | Checks if the Web page is currently using a custom tool pane. For example, if the page is loaded in SharePoint Designer. | |
ConcatUrls | Concatenates two URL strings into one. | |
ConvertHtmlLinkToWikiLink(String, SPList) | Converts HTML to Wiki tags given an input string and the URL for a list. | |
ConvertHtmlLinkToWikiLink(String, String) | Converts HTML to Wiki tags given an input string and the URL for a folder. | |
ConvertSPRightsToSPBasePermissions | Converts SPRights bit mask into SPBasePermissions bit mask. | |
ConvertWikiLinkToHtmlLink(String, SPList) | Converts Wiki tags to HTML given the URL for a list. | |
ConvertWikiLinkToHtmlLink(String, String) | Converts Wiki tags to HTML given the URL for a folder. | |
CreateDateTimeFromISO8601DateTimeString | Converts the specified ISO 8601 date-time value to a string DateTime format. | |
CreateDateTimeFromSqlString | Converts the specified SQL string (in yyyymmdd hh:mm:ss format) to DateTime format. | |
CreateEmailBodyForInvitation | Returns a string that can be used as the body of an email message that contains a link to a SharePoint Foundation page. | |
CreateISO8601DateTimeFromSystemDateTime | Converts a system DateTime value to ISO8601 DateTime format (yyyy-mm-ddThh:mm:ssZ). | |
CreateNewDiscussion(SPList, String) | Creates a new SPListItem representing a discussion in a specified list. | |
CreateNewDiscussion(SPListItemCollection, String) | Creates a new SPListItem representing a discussion in a specified collection of list items. | |
CreateNewDiscussionReply | Creates a new SPListItem representing a reply to another item in a Discussion Board. | |
CreateNewWikiPage | Adds a new Wiki page to a Wiki page library. | |
CreateParentFoldersForFile | Creates a folder hierarchy necessary to create a list item, including the list in which to create the item, as well as an indication whether to create additional list items that correspond to the folders. | |
CreateSystemDateTimeFromXmlDataDateTimeFormat | Converts the date and time value from ISO8601 DateTime format (YYYY-MM-DDTHH:MM:SSZ) to system DateTime format (mm/dd/yyyy hh:mm:ss AM or PM). | |
CreateThreadIndex | Creates a new conversation thread-index from a parent conversation thread-index. | |
DetermineRedirectUrl | Helper function that determines a redirection URL, typically for server-side redirects. For example, a redirection that uses SPUtility.Redirect. | |
DoesFieldSupportIsRelationship | Returns a Boolean value that indicates whether a lookup field has relationship features. | |
DumpTypes | Obsolete. | |
EnsureAuthentication() | Determines whether the current user is authenticated, and that a context Web for the current HTTP request exists; otherwise, asks the user to authenticate. | |
EnsureAuthentication(SPWeb) | Determines whether the current user is authenticated, and that the web parameter is not a null reference (Nothing in Visual Basic); otherwise, requests the user to authenticate. | |
EnsureSessionCredentials | Obsolete. | |
EnsureSiteAdminAccess | Determines whether the current user is a site administrator on the specified site and, if not, requests a user name and password, and then opens the Error page for an “access denied” exception so that the user must request access to the site or list from the owner. | |
ExecuteCellStorageBinaryRequest(SPFile, Stream, Boolean, Guid, String, Boolean, String, Boolean, String, String, String, Int64, String, Int64, Boolean, String, Boolean, Int32, String, Boolean, Boolean) | Executes a cell storage request on an SPFile object. | |
ExecuteCellStorageBinaryRequest(SPFile, Stream, Boolean, Guid, String, Boolean, String, Boolean, String, String, String, Int64, String, Int64, Boolean, String, Boolean, Int32, String, Boolean, Boolean, Int32) | Executes a cell storage request on an SPFile object. | |
ExecuteProxyOperation | Called from full trust code running in the Windows SharePoint User Code Service worker process in order to execute an operation that cannot otherwise be performed in the process. This method cannot be called directly by user code. | |
ExecuteRegisteredProxyOperation | Executes an operation that is prevented in the shim in the proxy process of the UserCode service. | |
FIsFatalException | Returns a Boolean value that indicates whether a specified exception is a fatal exception. | |
FIsProcessCriticalException | Returns a Boolean value that indicates whether a specified exception is a critical exception. | |
FlushIISToken | Invalidates the user token for all application pool accounts. | |
FormatAccountName(String) | Retrieves a concatenated string containing the provider and user values in order, separated by a colon (":"). This method retrieves the concatenated string based only on the user name. | |
FormatAccountName(String, String) | Validates the provider and user string values. If these strings are valid, this method concatenates the provider and user values in order, with a colon (":") between them, and returns the concatenated string. | |
FormatDate | Converts the specified date and time value to an SPDateFormat format. | |
FormatSize | Determines the format size, in megabytes or kilobytes. | |
FormatStringWithListType(String, SPList) | Format a string by inserting the name that corresponds to a list’s SPBaseType. | |
FormatStringWithListType(String, SPList, Boolean) | Format a string by inserting the name that corresponds to a list’s SPBaseType, optionally converting the type name to lowercase. | |
GetAcceptHeaderExtensions | Returns the set of accept headers associated with file extensions defined in the configuration file for a site. | |
GetAccountName | Retrieves an account name, without provider information, given the full username associated with the account. | |
GetAllAuthenticatedUsers | ||
GetBinaryUserId | Returns the binary identifier of the membership account. | |
GetCalendarYearMax | Returns the maximum year that can be represented in calendars. | |
GetCalendarYearMin | Returns the minimum year that can be represented in calendars. | |
GetCurrentUserEmailAddresses | Returns a string containing the email address of the current user. | |
GetExampleDateFormat | Returns an example of the format that is used for dates in the specified site. | |
GetExpandedWeeks | ||
GetFullNameandEmailfromLogin(SPGlobalAdmin, String, String, String) | Returns the display name and the e-mail address of the user on a server or server farm with the specified user name. | |
GetFullNameandEmailfromLogin(SPWeb, String, String, String) | Returns the display name and the e-mail address of the Web-site user who has the specified user name. | |
GetFullNameFromLogin(SPGlobalAdmin, String) | Returns the display name of the user on a server or server farm with the specified user name. | |
GetFullNameFromLogin(SPSite, String) | Returns the display name of the site user who has the specified user name. | |
GetFullNameFromLoginEx(String, Boolean) | Returns the display name of a user with the specified user name and a Boolean value indicating whether the user object represents a distribution list. | |
GetFullNameFromLoginEx(SPSite, String, Boolean) | Returns the display name of a user on the specified site based on the user name and a Boolean value indicating whether the user object represents a distribution list. | |
GetFullUrl | Returns the absolute Universal Resource Locator (URL) for the specified server-relative URL. | |
GetGenericSetupPath | Retrieves the full local path for the specified subdirectory. | |
GetHtmlTranslateUrlFromExt | Returns the Universal Resource Locator (URL) of a back-end converter program that is used to handle a request when the client computer does not have the Microsoft Office application installed. | |
GetIdentifierFromEmail | Obsolete. Returns the identifier (ID) of the site user based on the specified e-mail address. | |
GetIncorrectUIVersionMessage | Retrieves a localized string that contains the generic error message to display when a Web Part is added to a site with an incompatible user interface (UI) version. | |
GetListGuid | Obsolete. | |
GetLocalizedString | Retrieves the value for a named resource string from the resource file for a specified language. | |
GetLoginNameFromEmail | Obsolete. Returns the domain user account of the user based on the specified site collection and e-mail address. | |
GetNewIdPrefix | ||
GetNonAdminGlobalSettings | ||
GetNTFullNameandEmailfromLogin(SPGlobalAdmin, String, String, String) | Retrieves the display name and e-mail address that are used in the Windows NT operating system for a specified user on the server or server farm. | |
GetNTFullNameandEmailfromLogin(SPWeb, String, String, String) | Retrieves the display name and e-mail address that are used in the Windows NT operating system for a user on the specified site. | |
GetPageUrlPath | Returns the URL to a page in a specified HTTP context. | |
GetParentControl | Returns the control that is the parent of a specified control. | |
GetPrincipalsInGroup | Gets users or groups that belong to the specified group. The specified group can be a Microsoft Windows security group, an ASP.NET role, or a SharePoint group. | |
GetProviderName | Returns the membership provider portion of a full user name. | |
GetRequestAccess | Obsolete. Returns a Boolean value that indicates whether the current user has access to the specified site or list. | |
GetRoleDefinitionFromLegacyWebGroupId | Gets the role definition for the web group with the specified ID from the specified collection of role definitions. | |
GetSelectedDate | Retrieves the CalendarDate parameter value from the request context. | |
GetSelectedDateFromSource | Retrieves the CalendarDate parameter value from the request context, optionally using the source page if necessary. | |
GetSelectedTime | Retrieves the CalendarTime parameter value from the request context. | |
GetSelectedTimeFromSource | Retrieves the CalendarTime parameter value from the request context, optionally using the source page if necessary. | |
GetServerNow | Returns in Coordinated Universal Time (UTC) the current date and time used on the database server for the specified site. | |
GetServerRelativeUrlFromPrefixedUrl | Converts a URL prefixed with "~site/" or "~sitecollection/" into a server-relative URL. | |
GetShortId | ||
GetSPListFromName(SPWeb, Guid, String, String, String) | Retrieves the specified SharePoint list without specifying the associated SPContext object. | |
GetSPListFromName(SPContext, SPWeb, Guid, String, String, String) | Retrieves the specified SharePoint list. | |
GetTimeSpanFromTimeZone | Retrieves a TimeSpan object that represents the difference in time between Coordinated Universal Time (UTC) and the time zone that is local to the SharePoint Web site. | |
GetUploadedSolutionOp | Retrieves the solution operation (op) code for a newly uploaded solution. | |
GetUrlDirectory | Returns the directory-path part of the URL. | |
GetUrlFileName | Returns the filename part of the URL. | |
GetV3SecurePassword | Returns a secure string that contains the password for a process identity. | |
GetViewType | Retrieves one of the calendar parameters from the request context. | |
GetWebContentIndexingTimestamps | ||
GregorianISOToIntlISODate | Converts the specified date from the International Organization for Standardization (ISO) Gregorian format to the ISO International format. | |
GuessLoginNameFromEmail | Obsolete. Returns the domain user account of the user based on the specified e-mail address. | |
HandleAccessDenied | Handles access denied exceptions. | |
HexStringToLong | Converts the specified hexadecimal value to a long value. | |
IsBuiltInFieldDisallowingUniqueness | Returns a Boolean value that indicates whether a field is one of the special system fields that are not allowed to have the EnforceUniqueValues property set to false. | |
IsClientValid | ||
IsDesignTimeRender | Indicates whether the current request is run in a design-time context. Usually this is because a Web service call is made by a Microsoft SharePoint Foundation-compatible editor, for example Microsoft SharePoint Designer 2010. | |
IsEastAsia | Determines whether the specified Locale ID (LCID) for the specified website is for an East Asia language. | |
IsEmailServerSet | Returns a Boolean value that specifies whether an e-mail server has been set for the site. | |
IsLoginValid(SPGlobalAdmin, String) | Uses the specified global administration object to determine whether the specified user name is valid. | |
IsLoginValid(SPSite, String) | Uses the specified site collection to determine whether the specified user name is valid. | |
IsLoginValid(SPGlobalAdmin, String, Boolean) | Uses the specified global administration object to determine whether the specified user name is valid and whether it corresponds to a user account. | |
IsRightToLeft | Determines if the language specified by the locale identifier (LCID) is a right-to-left language. | |
IsUplevelBrowser | Returns a Boolean value that indicates whether the version of the browser is later than Internet Explorer 5.0 or Netscape Navigator 6.0, based on the HTTP context of the request. | |
IsValidStringInput | Determines whether the specified text is in a valid format as specified by a regular expression. | |
MakeBrowserCacheSafeLayoutsUrl | Returns a new URL that will not be cached by the browser when the associated file changes. The file name must be relative to the layouts directory in the file system. For example, if an URL contains "layouts/images" it is relative to the layouts directory but the images directory is not under the layouts directory in the file system and therefore it cannot be used with this method. | |
MakeBrowserCacheSafeScriptResourceUrl | Generates a new URL that is safe for the browser to use to cache the resource content. If the resource content was changed on the server, the URL that this method retrieves is changed to ensure that the stale browser cache is not used. | |
MapToControl | Returns the name of the control that can edit the specified file, including the website that contains the file and the ID of the program that created the file. | |
MapToIcon(SPWeb, String, String) | Returns the name of the image file for the icon that is used to represent the specified file. | |
MapToIcon(SPWeb, String, String, IconSize) | Returns the name of the image file for the icon that is used to represent the specified file. | |
MapToServerFileRedirect(SPWeb, String, String) | Returns the redirection URL for the file. | |
MapToServerFileRedirect(SPWeb, String, String, Int32) | Returns the redirection URL for the file or for its versions. | |
MapWebToIcon | Maps a Web-site to a corresponding image and tooltip based on the template and configuration identifier for the site. | |
MapWebURLToVirtualServerURL | Returns the absolute Universal Resource Locator (URL) for the virtual server that contains the specified site. | |
ObjectToGuid | Converts an object to a Guid structure. | |
ParseDate(SPWeb, String, SPDateFormat, Boolean) | Creates a System.DateTime object from the specified strings containing date and time values. | |
ParseDate(SPWeb, String, String, Boolean) | Creates a System.DateTime object from the specified strings containing date and time values. | |
ParseSqlType | Converts the string representation of a SqlDbType enumeration value to a SqlDbType enumeration value. | |
Redirect(String, SPRedirectFlags, HttpContext) | Handles the redirection of an HTTP request. | |
Redirect(String, SPRedirectFlags, HttpContext, String) | Handles the redirection of an HTTP request. This method allows for the optional specification of an encoded query string to be added to the URL. | |
RedirectValidate(String, SPWeb) | Determines whether a URL is suitable for redirection by verifying that it is either relative or resides within the current Web server or portal server within the current Web application. | |
RedirectValidate(String, HttpContext) | Determines whether a URL is suitable for redirection by verifying that it is either relative or resides within the current Web server or portal server. | |
ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(String) | Converts the specified relative URL with an embedded prefix to a server-relative URL and specifies the server URL. | |
ReplaceEmbeddedPrefixedUrlsWithServerRelativeUrls(String, Boolean) | Converts the specified relative URL with an embedded prefix to a server-relative URL and optionally encodes the site prefix. | |
ResolvePrincipal(SPWebApplication, Nullable<SPUrlZone>, String, SPPrincipalType, SPPrincipalSource, Boolean) | Resolves principal information into an SPPrincipalInfo object. | |
ResolvePrincipal(SPWeb, String, SPPrincipalType, SPPrincipalSource, SPUserCollection, Boolean) | Resolves principal information into an SPPrincipalInfo object. | |
ResolveWindowsPrincipal(SPWebApplication, String, SPPrincipalType, Boolean) | ||
ResolveWindowsPrincipal(SPWeb, SPWebApplication, String, SPPrincipalType, Boolean) | ||
SearchPrincipals(SPWebApplication, Nullable<SPUrlZone>, String, SPPrincipalType, SPPrincipalSource, Int32, Boolean) | ||
SearchPrincipals(SPWeb, String, SPPrincipalType, SPPrincipalSource, SPUserCollection, Int32, Boolean) | ||
SearchWindowsPrincipals | ||
SendAccessDeniedHeader | Requests a user name and password, and then opens the Error page for an access denied exception so that the user must request access to the site or list from the owner. | |
SendEmail(SPWeb, StringDictionary, String) | Sends an e-mail message. | |
SendEmail(SPWeb, StringDictionary, String, Boolean) | Sends the e-mail message to the specified address. | |
SendEmail(SPWeb, Boolean, Boolean, String, String, String) | Sends an e-mail message. | |
SendEmail(SPWeb, Boolean, Boolean, String, String, String, Boolean) | Sends the e-mail message to the specified address. | |
SendRequestAccessToOwner | Sends a request for access in an e-mail message to the owner of the list or site. | |
SetEventReceiverToSynchronous | ||
SetThreadCulture(SPWeb) | Sets the thread and user interface (UI) culture, based upon the spWeb parameter and the RegionalSettings property of the user. | |
SetThreadCulture(CultureInfo, CultureInfo) | Sets the thread and user interface (UI) culture, based upon the current culture of the thread and the current culture of the UI. | |
StopRequestIfClientIsNotValid | Stops processing the current request if the request is no longer valid. | |
StringToUInt64 | Converts the specified text value to a 64-bit unsigned integer. | |
TestVss | Obsolete. | |
TimeDeltaAsString | Returns the difference between two specified DateTime values as a string. | |
TransferToErrorPage(String) | Transfers the request to a Microsoft SharePoint Foundation error page. | |
TransferToErrorPage(String, String, String) | Transfers the request to a Microsoft SharePoint Foundation error page. | |
TransferToSuccessPage(String) | Transfers the request to a Microsoft SharePoint Foundation success page. | |
TransferToSuccessPage(String, String, String, String) | Transfers the request to a Microsoft SharePoint Foundation success page. | |
TryGetStringFromBinaryUserId | Tries to extract a string from the binary user identifier and returns it. | |
ValidateDatabaseConnectionString | Obsolete. Validates the connection string for the content database or the configuration database. | |
ValidateFormDigest | Validates the form digest control that is used in the current request. |
Top
Fields
Name | Description | |
---|---|---|
AccessDeniedPage | Contains the name of the “access denie”d page. | |
AuthenticatePage | Contains the name of the authenticate page. | |
ConfirmationPageId | Contains a query string parameter for the confirmation page ID. | |
ConfirmationPageText | Contains a query string parameter for the confirmation page text. | |
CustomXslAttribute | Contains a query string parameter for the custom XSL attribute. | |
ErrorCorrelationId | Contains a query string parameter for the ID of the error correlation. | |
ErrorHelpKey | Contains a query string parameter for the key of the error help. | |
ErrorHelpLinkText | Contains a query string parameter for the text of the error help link. | |
ErrorID | Contains a query string parameter for the ID of the error. | |
ErrorLinkhref | Contains a query string parameter for the navigate URL of the error link. | |
ErrorLinkTextID | Contains a query string parameter for the text ID of the error link. | |
ErrorPage | Contains a query string parameter for the name of the error page. | |
ErrorText | Contains a query string parameter for the error text of the error link. | |
MaxLeafNameLength | Indicates the maximum number of characters that can be used in the name of a file or folder. | |
MaxUserAccountNameLength | Contains the maximum length of the account name of the user. | |
MaxUserLogonLength | Contains the maximum length of the logon name of the user. | |
RequestHdrNoLinkOnErrPage | Contains a query string parameter for the no links on the error page. | |
SiteRelativeUrlPrefix | The value of this string is ~sitecollection/. | |
strTRUE | Contains a query string parameter to represent true. | |
SuccessPage | Contains the name of the success page. | |
WebRelativeUrlPrefix | The value of this string is ~site/. |
Top