SPWebApplication.GetMappedPage 方法 (SPWebApplication.SPCustomPage)

返回自定义应用程序页中的位置。

命名空间:  Microsoft.SharePoint.Administration
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Function GetMappedPage ( _
    key As SPWebApplication.SPCustomPage _
) As String
用法
Dim instance As SPWebApplication
Dim key As SPWebApplication.SPCustomPage
Dim returnValue As String

returnValue = instance.GetMappedPage(key)
public string GetMappedPage(
    SPWebApplication.SPCustomPage key
)

参数

返回值

类型:System.String
自定义应用程序页面的位置。否则为空引用(无 在 Visual Basic 中)。

示例

下面的代码示例演示如何检索应用程序页映射并使用SPWebApplication.SPCustomPage枚举对象。

using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;

namespace GetCustomAppPage
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("https://localhost"))
            {
                //Get a reference to the web application.
                SPWebApplication webApp = site.WebApplication;

                //Output the name of the custom application page.
                Console.Out.WriteLine(webApp.GetMappedPage(SPWebApplication.SPCustomPage.AccessDenied));
                
                Console.Out.WriteLine("Press any key...");
                Console.ReadKey();
            }
        }
    }
}
Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Administration
Module Module1

    Sub Main()

        Using site As New SPSite("https://localhost")

            'Get a reference to the web application.
            Dim webApp As SPWebApplication = site.WebApplication

            'Output the newly assigned application page.
            Console.Out.WriteLine(webApp.GetMappedPage(SPWebApplication.SPCustomPage.AccessDenied))

            Console.Out.WriteLine("Press any key...")
            Console.ReadKey()
        End Using

    End Sub

End Module

另请参阅

引用

SPWebApplication 类

SPWebApplication 成员

GetMappedPage 重载

Microsoft.SharePoint.Administration 命名空间