Saturday, February 11, 2012

Adds a link to the My Links page on the My Site for the specified account name.

using System;
using System.Collections.Generic;
using System.Text;
 
// TODO 
// Change the using AddLinkSample.MyServer002 directive
// to point to the Web service you are referencing.
using AddLinkSample.MyServer002;
 
namespace AddLinkSample
{
    class Program
    {
        static void Main(string[] args)
        {
            //Instantiate the Web service. 
            UserProfileService userProfileService = new UserProfileService();
 
            //Set credentials for requests.
            //Use the current user log-on credentials.
            userProfileService.Credentials =
                System.Net.CredentialCache.DefaultCredentials;
 
            // TODO 
            // Replace "domain\\username" with valid values.
            userProfileService.AddLink("domain\\username", "Developer Resources", "http://example", "Development", Privacy.Organization);
 
        }
    }
}

No comments:

Post a Comment