次の方法で共有


SPUtility.FormatAccountName method (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.

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

Syntax

'Declaration
Public Shared Function FormatAccountName ( _
    user As String _
) As String
'Usage
Dim user As String
Dim returnValue As String

returnValue = SPUtility.FormatAccountName(user)
public static string FormatAccountName(
    string user
)

Parameters

  • user
    Type: System.String

    A string providing the name of the user.

Return value

Type: System.String
A concatenation of the provider and user strings, in order, separated by a colon (":").

Remarks

This method calls the FormatAccountName(String, String) method, passing it the Membership.Provider.Name value for the first parameter. That method validates provider and user values before concatenating the strings. If either of the provider or user values is empty or null, the ArgumentNullException exception is thrown. If the provider string contains a colon (":"), the ArgumentException exception is thrown.

See also

Reference

SPUtility class

SPUtility members

FormatAccountName overload

Microsoft.SharePoint.Utilities namespace