共用方式為


SPUrlUtility.IsLegalFileName Method

Validates the specified URL leaf name.

Namespace:  Microsoft.SharePoint.Utilities
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
Public Shared Function IsLegalFileName ( _
    name As String _
) As Boolean
'Usage
Dim name As String
Dim returnValue As Boolean

returnValue = SPUrlUtility.IsLegalFileName(name)
public static bool IsLegalFileName(
    string name
)

Parameters

Return Value

Type: System.Boolean
Returns a Boolean value of true if the specified leaf name is valid; otherwise, this method returns false.

See Also

Reference

SPUrlUtility Class

SPUrlUtility Members

Microsoft.SharePoint.Utilities Namespace