共用方式為


How to: Use the Published Links Web Service

Applies to: SharePoint Server 2010

Microsoft SharePoint Server 2010 provides the Published Links Web service so Microsoft Office clients and other interested applications can obtain the list of published links on the server that are targeted to the current user. These links point to Microsoft SharePoint 2010 sites that are available for publishing information from Office clients and other applications for that user. The Administration interface and the object model allow you to add published links to the server.

The Web service is located at http://<site URL>/_vti_bin/publishedlinks.asmx.

Example

The following code example displays the links to the Windows SharePoint Services sites that are available to the current user for publishing information from Office clients and other applications.

using System;
using System.Collections.Generic;
using System.Text;

namespace PublishedLinksWebServiceApp
{
    class Program
    {
        static void Main(string[] args)
        {
            localhost.PublishedLinksService myService =
            new PublishedLinksWebService.localhost.PublishedLinksService();
            myService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            localhost.ServerLink[] links = myService.GetLinks();
            for (int i = 0; i < links.Length; i++)
            {
                Console.WriteLine(links[i].Url);
            }
        }
    }
}

See Also

Tasks

How to: Use the Web Service to Find What's Common Between Two User Profiles

How to: Use the Web Service to Modify User Profile Data

How to: Use the Web Service to Retrieve Profile Data of a User

How to: Use the Web Service to Add Links and Colleagues