1: namespace ModifyUserPropertyByNameSample
2: {
3: class Program
4: {
5:
6: static void Main(string[] args)
7: {
8: //Instantiate the Web service.
9: UserProfileService userProfileService =
10: new UserProfileService();
11:
12: //Set credentials for requests.
13: //Use the current user log-on credentials.
14: userProfileService.Credentials =
15: System.Net.CredentialCache.DefaultCredentials;
16:
17: PropertyData[] newdata = new PropertyData[1];
18: newdata[0] = new PropertyData();
19:
20: newdata[0].Name = "FirstName";
21: newData[0].IsValueChanged = true;
22:
23: newdata[0].Values = new ValueData[1];
24: newdata[0].Values[0] = new ValueData();
25: newdata[0].Values[0].Value = "Mark";
26:
27: // TODO
28: // Replace "domain\\username" with valid values.
29: userProfileService.ModifyUserPropertyByAccountName
30: ("domain\\username", newdata);
31:
32: }
33: }
34: }