共用方式為


SPWebApplication.GetMappedPage method (SPWebApplication.SPCustomPage)

會傳回自訂應用程式] 頁面上的位置。

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

Syntax

'宣告
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
)

參數

傳回值

Type: System.String
自訂應用程式] 頁面上的位置。否則,請a null reference (Nothing in Visual Basic)。

Examples

下列程式碼範例會示範如何擷取使用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 class

SPWebApplication members

GetMappedPage overload

Microsoft.SharePoint.Administration namespace