The following code can retrieve a file from a SharePoint library by suing the WebClient class. You will need the credentials of the SharePoint site to create a connection. The file is retrieved as binary and stored into a local file. Eventually you get an FileStream object back pointing to the downloaded file. byte[] binFile = null; System.IO.FileStream fs = null; System.IO.BinaryReader rdr = null; string tempFileName = "C:\\tmp"; string url = http://portal.demo.nl/lists/doclib/mydoc.docx...
During one of our projects we needed to create a new SiteGroup, add users to it and define some roles.The following code can be used for adding a SiteGroup to a site in WSS or MOSS. SPWeb currentWeb = SPContext.Current.Web; SPUser currentUser = currentWeb.CurrentUser; currentWeb.SiteGroups.Add("MyGroup", currentUser, currentUser, "My new group"); Then we need to get the group based on its name and add the roles to it based on the names of the roles. SPGroup group = currentWeb...
The Limited Access permission level is designed to be combined with fine-grained permissions to give users access to a specific list, document library, item, or document, without giving them access to the entire site. However, to access a list or library, for example, a user must have permission to open the parent Web site and read shared data such as the theme and navigation bars of the Web site. The Limited Access permission level cannot be customized or deleted. You cannot assign this permission...