共用方式為


SPUrlUtility.IsProtocolAllowed Method (String)

Gets a Boolean value indicating whether the specified URL uses a supported protocol.

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 IsProtocolAllowed ( _
    fullOrRelativeUrl As String _
) As Boolean
'Usage
Dim fullOrRelativeUrl As String
Dim returnValue As Boolean

returnValue = SPUrlUtility.IsProtocolAllowed(fullOrRelativeUrl)
public static bool IsProtocolAllowed(
    string fullOrRelativeUrl
)

Parameters

  • fullOrRelativeUrl
    Type: System.String

    A string that contains the full or relative URL.

Return Value

Type: System.Boolean
true if the URL uses a supported protocol; otherwise, false.

Remarks

To return an array of allowed protocols, use the AllowedProtocols property.

See Also

Reference

SPUrlUtility Class

SPUrlUtility Members

IsProtocolAllowed Overload

Microsoft.SharePoint.Utilities Namespace