## how to get the list items in sharepoint 2013 using c#

I have tried this code but it is not working..

 SPWeb web = SPContext.Current.Web;  SPList list = web.Lists.TryGetList("Vehicle");  SPListItemCollection coll = list.GetItems();  foreach (SPItem item in coll)  {      string vehId = (item.ID).ToString();      Label1.Text = (string)item["AssignDriver"];  } 

## List of valuable foders for preventing their deletions

I am writing software that has an option to delete all files is a user-specified directory. This is the usual case for software. For example, cpp compiler has an option to delete all previously generated binaries.

But as far as the user can pass to my program any path, it may appear that he will accidentally remove his home directory together with all its content. Or the content of /etc/bin. Or any other directory that matter, but is not protected by the file system for the current user.

I can check the home directory myself, but I can’t know all possible weak parts, especially in the case when my software is cross-platform. So the question:

Is there exists any list of paths that are not recommended to delete by the user? So I can simply match user input by the pattern and at least warn him.

## Search not searching each column in custom list

Good Morning;

I have created a Custom List which is acting as a corporate directory. Using the search box in the “Standard View”, it will only search certain columns. I.E. First Name and Employee Number. It won’t bring up any results if I search by Last Name.

Any help? I am using SP2013 OP

Thanks

## Least common multiple of a list of numbers

I’m trying to learn computer science by doing some challenges. One is the following.

2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.

What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

Let’s generalize the problem from $$1$$ to $$n$$.

I thought of a loop between $$n$$ and $$n/2$$ as everything above $$n/2$$ is a multiple of something between $$1$$ and $$n/2$$. At each iteration, the result is the least common multiple of the loop variable and the precedent result (at the beginning the result is 1).

If I am correct, the complexity of this should be $$\mathcal{O}(n/2)$$. Am I right?

Is there any more efficient algorithms to solve this problem? If so witch one and what is their complexity?

## Compare two lists and produce a list of names not duplicated

I have one list of total available people and the second list of people who have been assigned. I would like to auto-populate a third list of the people (from the first list) who have not been assigned (list B). Basically whichever names from column A that are not used in Column B would show up in Column C.

+----+----------+----------+----------+ |    | A        | B        | C        | +----+----------+----------+----------+ | 1  |   All    | Assigned |   Free   | +----+----------+----------+----------+ | 2  | AJ       | AJ       | Dayna    | +----+----------+----------+----------+ | 3  | Dayna    | Leah     | Kristina | +----+----------+----------+----------+ | 4  | Kristina | Mag      | Mai      | +----+----------+----------+----------+ | 5  | Leah     | Milla    | Sarah    | +----+----------+----------+----------+ | 6  | Mag      | Mimi     |          | +----+----------+----------+----------+ | 7  | Mai      | Oksana   |          | +----+----------+----------+----------+ | 8  | Milla    | Richelle |          | +----+----------+----------+----------+ | 9  | Mimi     |          |          | +----+----------+----------+----------+ | 10 | Oksana   |          |          | +----+----------+----------+----------+ | 11 | Richelle |          |          | +----+----------+----------+----------+ | 12 | Sarah    |          |          | +----+----------+----------+----------+ 

## Add banned words list to the site

I want to add a banned words list to the site. and if a user used one of the banned word in node form (title and body), comment form (title and body), user username in the registration form, then the user should get an error message that you are using a banned word in your {field-name}.

And the form should not be submitted if the banned words are present.

How can I do this?

I have checked some modules like wordfilter but it does not provide the functionality for usernames and also it replaces the strings not giving the error message.

## Send invitations to Outlook with ICS format from a SharePoint Calendar List

I’m looking for the best way to implement sending invitations from a SharePoint list of events.

Scenarios:

• Create an Event
• Creation of a repeating event
• Exception recurrences
• Delete an event

I was exploring options:

• Create an event handler to send the mail, but I have trouble generating the ICS format
• Use the option to export out of the box with some programming to make it more friendly

What approach would you recommend? Thanks in advance.

Possible solution

One possible solution I’ve been evaluating is the proposal in this blog.

Deliver meeting request from Sharepoint Calendar programmatically

Here they have developed a library (iCal.cs) that takes an item from a Events SharePoint list and creates the ical file. It is a good starting point, but there are points that still require further development:

• Managing the list of attendees. In particular the addition or removal.
• How to handle cancellations.

It should also be noted that this solution is based on a full calendar export and not the individual appointment.

Note: I do not say that this is the ideal solution. But it is a very good example of the problem being solved.

Sample exporting a complete SharePoint Calendar

The file “iCal Exporter 1.0 Source.zip” from The Community Kit for SharePoint helps to undestand de complexity of SharePoint Event List.

Understanding the SharePoint calendar

A must-o-read article accessing SharePoint calendars via the object model with so many different types of events – normal events, all-day events, recurring events, recurrence exceptions, and deleted instances

Understanding the SharePoint calendar and how to export it to iCal format

Functional description

• I know how to write event receiver
• I know how to send the email
• What are looking for is some code to translate events from calendar list to ical because this list has some complexity and diferents types of events
• If you look in this blog you can see iCal.cs. This library take the complexity of the translation, but I think for a complete calendar translation. I am looking someting like this but to add in same event receivers. This library shows the complexity behind. And my intention is not to develop it from scratch.
• Event receivers in sharepoint calendar list are not “natural”. For instance: when you modify an exception of a recurring appointment, an item for the exception is created. And the recurring item changes. Two events are triggered. And you must decide in which event send the iCal file. There are a lot of combinations. Because of event type, exceptions, and more things
• It is very strange here are not something out of the box. Because MS seems to have a way to generate Ical. Since there is a tab “custom action” in the event screen. Look here: Export (.ical) Individual Events from SharePoint Calendar

## 66290 urls Scrapebox Autoapprove list tested and all links working 19-04-2019 NEW LISTS WILL FOLLOW for $35 Great list of Autoapprove comment list for Scrapebox. Current results are 66290 unique urls for posting and all are tested within the last few days. Every week I will release new fresh 100% working and tested autoapprove lists for Scrapebox here. Send me a message here if you want to keep updated and I will provide the link to any new completed and tested list I will place here. by: dnc0101 Created: — Category: Other Viewed: 270 ## How to use SharePoint REST API to get newest list item? Trying to get the newest item added to a list. Get item by id, works: $  .ajax({ url: xurl + "/_api/web/lists('" + xlist + "')/items/getById(123)",  type: "GET", headers: { "Accept": "application/json;odata=verbose", },   success: function (data) {     var xid = data.d.ID;     alert(xid);},   error: function (error) { alert(JSON.stringify(error)); } }); 

Get top item, doesn’t work, returns undefined:

$.ajax({ url: xurl + "/_api/web/lists('" + xlist + "')/items?$  top=1&\$  orderby=ID desc",  type: "GET", headers: { "Accept": "application/json;odata=verbose", },   success: function (data) {     var xid = data.d.ID;     alert(xid);},   error: function (error) { alert(JSON.stringify(error)); } }); 

Suggestions?