using (var ctx = new ClientContext(webUri)) | |
{ | |
ctx.Credentials = CreateSPOCredentials(userName, password); | |
var list = ctx.Web.Lists.GetByTitle(listTitle); | |
var item = list.GetItemById(itemId); | |
KeywordsManager.SetTaxKeywordValue(item,new []{"2013","2010"}); | |
item.Update(); | |
ctx.ExecuteQuery(); | |
} | |
public static SharePointOnlineCredentials CreateSPOCredentials(string userName,string password) | |
{ | |
var securePassword = new SecureString(); | |
foreach (var ch in password) | |
{ | |
securePassword.AppendChar(ch); | |
} | |
return new SharePointOnlineCredentials(userName, securePassword); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment