Is there a way to tell where a Mathematica file came from, meaning some type of machine ID (yes, I know about $MachineID). I want to be able to identify students who are sharing files, i.e. one student creating the file and giving it to others. Anti-cheating is what I'm trying to accomplish.


Question: SPListItem.Delete() has some issues
Answer: I guess you might be using the following code:

SPListItemCollection delItemCol = customList.GetItems(spQuery);

for(int count=0; count&lt; delItemCol.Count ;count++)
delItemCol[count].delete();

Now here we can't use the foreach because if you try to modify the collection of SPListItemCollection, it will throw exception. So best is to use the for loop.

If you analyse the counter and delItemCol.Count.

        counter      delItemCol.Count
        0           20
        1           19
        2           18
        3           17
        4           16
        5           15
        6           14
        7           13
        8           12
        9           11
        10          10
        11           9


So...after sometime the value of delItemCol.Count is less than counter and will throw exception.

So how to deal with this in simplest way. Either use double for loop a or ProcessBatchData.
This is not a manual code without any kind of testing. But it must work.