Guest User

Untitled

a guest
Jan 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. //using our client context, load the folder of the files we want links to
  2. Folder folder = Program.spConnection.context.Web.GetFolderByServerRelativeUrl(Properties.Settings.Default.SPImages);
  3.  
  4. FileCollection filec = folder.Files;
  5. Program.spConnection.context.Load(filec);
  6. Program.spConnection.context.ExecuteQuery();
  7.  
  8. List<string> allSharedURLs = new List<string>();
  9. //Load Each File in the folder
  10. foreach (File f in filec)
  11. {
  12. Program.spConnection.context.Load(f);
  13. Program.spConnection.context.ExecuteQuery();
  14.  
  15. // I would like to add the publically shared url to the list at this point
  16. // allSharedURLs.Add( theLink );
  17. }
  18.  
  19. var item = //code to get list item..
  20. var objSharingInfo = ObjectSharingInformation.GetObjectSharingInformation(
  21. clientContext, item, false, true, false, true, true, true, true);
  22. clientContext.Load(sharingInfo);
  23. clientContext.ExecuteQuery();
  24. //objSharingInfo.AnonymousEditLink
  25. //objSharingInfo.AnonymousViewLink
Add Comment
Please, Sign In to add comment