SPAlternateUrlCollectionManager.SerializeUrlForStorage 方法
序列化指定的 URL 的格式适用于持久性存储区中。
命名空间: Microsoft.SharePoint.Administration
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
Public Function SerializeUrlForStorage ( _
url As String _
) As String
用法
Dim instance As SPAlternateUrlCollectionManager
Dim url As String
Dim returnValue As String
returnValue = instance.SerializeUrlForStorage(url)
public string SerializeUrlForStorage(
string url
)
参数
url
类型:System.String一个字符串,包含要序列化的 URL。
返回值
类型:System.String
一个字符串,包含序列化的 URL。
示例
下面的示例验证SerializeUrlForStorage方法序列化要匹配默认区域传出 URL 的 URL。
Dim altUrlCollection As SPAlternateUrlCollection = SPContext.Current.Site.WebApplication.AlternateUrls
Dim altUrlCollectionMgr As SPAlternateUrlCollectionManager = SPFarm.Local.AlternateUrlCollections
Dim responseUrl As String = altUrlCollectionMgr.SerializeUrlForStorage("http://MySerializedURL")
Dim altUrl As SPAlternateUrl = altUrlCollection.GetResponseUrl(SPUrlZone.Default)
If responseUrl.Equals(altUrl.IncomingUrl) Then
Response.Write("Serialized URL matches outgoing URL.")
End If
SPAlternateUrlCollection altUrlCollection = SPContext.Current.Site.WebApplication.AlternateUrls;
SPAlternateUrlCollectionManager altUrlCollectionMgr = SPFarm.Local.AlternateUrlCollections;
string responseUrl = altUrlCollectionMgr.SerializeUrlForStorage("http://MySerializedURL");
SPAlternateUrl altUrl = altUrlCollection.GetResponseUrl(SPUrlZone.Default);
if (responseUrl.Equals(altUrl.IncomingUrl))
{
Response.Write("Serialized URL matches outgoing URL.");
}
另请参阅
引用
SPAlternateUrlCollectionManager 类