Thursday 10 July 2014

SharePoint Read Document Library using Object modal

using (SPSite osite = new SPSite("http://SP"))
{
using (SPWeb ObjWeb = osite.OpenWeb())
{
SPFile ofile = ObjWeb.GetFile("/site/DocumentLib/MyDocument.doc");
if (!ofile.Exists)
{
//Do some action
}
}
}