Difference between SPFile.Property and SPFile.Item?
I have this code (f
is a SPFile object):
f.Properties["Publish"] = 0;
//f.Properties["开发者_如何学CPublishedDate"] = DateTime.Now;
f.Update();
If I run this it updates my Publish meta data. If I uncomment the date line it will error out with a type mismatch.
If I use this code:
f.Item["Publish"] = 0;
f.Item["PublishedDate"] = DateTime.Now;
f.Item.Update();
Everything updates as expected. What is the difference between these two methods? Why do they almost do the same thing?
You may want to have a look at a similar question I asked some time ago When is SPFile.Properties != to SPFile.Item.Properties in SharePoint?
精彩评论